Skip to content

Instantly share code, notes, and snippets.

@dplummer
Created August 4, 2014 03:55
Show Gist options
  • Save dplummer/e357abb2550ce1c96fd6 to your computer and use it in GitHub Desktop.
Save dplummer/e357abb2550ce1c96fd6 to your computer and use it in GitHub Desktop.
running go binary as service on ubuntu
# 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
@dplummer
Copy link
Author

dplummer commented Aug 4, 2014

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 run sudo service bloggo start. Restart on deploy is sudo service bloggo restart. It's pretty rudimentary, I'm sure there's a way to get it to restart without dropping any connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment