Skip to content

Instantly share code, notes, and snippets.

@amonroe
Forked from ngryman/service.conf.sh
Created December 30, 2012 19:11
Show Gist options
  • Select an option

  • Save amonroe/4414451 to your computer and use it in GitHub Desktop.

Select an option

Save amonroe/4414451 to your computer and use it in GitHub Desktop.
#!upstart
description "your fancy description that no one will see ;)"
author "Your Name <youremail@fqdn>"
# start on every run level, 2 is the one on Ubuntu
start on runlevel [2345]
# stop on halt, maintenance or reboot
stop on runlevel [016]
# start our application with the user `user`
exec sudo -u user -i NODE_ENV=production forever start /home/user/path/to/server >> /home/user/path/to/server/syslog 2>&1
# starting log
pre-start script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /home/user/path/to/server/syslog 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment