Skip to content

Instantly share code, notes, and snippets.

@hqingyi
Forked from c4milo/yourservice.conf
Created November 23, 2015 07:05
Show Gist options
  • Save hqingyi/4573a60da0884cfea69d to your computer and use it in GitHub Desktop.
Save hqingyi/4573a60da0884cfea69d to your computer and use it in GitHub Desktop.
upstart example script
# Ubuntu upstart file at /etc/init/yourservice.conf
pre-start script
mkdir -p /var/log/yourcompany/
end script
respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel [06]
script
su - youruser -c "NODE_ENV=test exec /var/www/yourcompany/yourproject/yourservice.js 2>&1" >> /var/log/yourcompany/yourservice.log
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment