Created
August 4, 2014 03:55
-
-
Save dplummer/e357abb2550ce1c96fd6 to your computer and use it in GitHub Desktop.
running go binary as service on ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# donaldplummer.com bloggo | |
description "donaldplummer.com blog" | |
start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345]) | |
stop on runlevel [!2345] | |
respawn | |
respawn limit 3 30 | |
console none | |
setuid deploy | |
setgid deploy | |
chdir /home/deploy/bloggo | |
env MARTINI_ENV=production | |
script | |
/home/deploy/bloggo/bloggo 2>&1 | logger -t bloggo | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the config file in
/etc/init/bloggo.conf
that I used to run by blog when I ran it with go. Using ubuntu 14.04 LTS. To start runsudo service bloggo start
. Restart on deploy issudo service bloggo restart
. It's pretty rudimentary, I'm sure there's a way to get it to restart without dropping any connections.