Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created April 4, 2014 03:53
Show Gist options
  • Save yuuichi-fujioka/9967779 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/9967779 to your computer and use it in GitHub Desktop.
upstart config file template
description "description of service"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
pre-start script
mkdir -p /var/run/${SERVICE_NAME}
end script
post-stop script
rm -rf /var/run/${SERVICE_NAME}
end script
script
[ -r /etc/default/${SERVICE_NAME} ] && . /etc/default/${SERVICE_NAME}
exec start-stop-daemon --start -c ${DAEMON_USER} --exec ${command}
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment