Last active
January 4, 2019 21:09
-
-
Save homburg/c13b7a75b08955f6902c to your computer and use it in GitHub Desktop.
Golang upstart init script (from githbucket.org/kardianos/service)
This file contains hidden or 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
# /etc/init/my-go-service.conf | |
# My go service | |
description "My go service" | |
env DAEMON=/usr/local/bin/my-go-service | |
env NAME=my-go-service | |
start on filesystem or runlevel [2345] | |
stop on runlevel [!2345] | |
#setuid username | |
kill signal INT | |
respawn | |
respawn limit 10 5 | |
umask 022 | |
#console none | |
pre-start script | |
test -x $DAEMON || { stop; exit 0; } | |
end script | |
# Start | |
script | |
test -f /etc/default/$NAME && . /etc/default/$NAME | |
exec $DAEMON | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment