Created
April 25, 2011 18:05
-
-
Save c4milo/940909 to your computer and use it in GitHub Desktop.
upstart example script
This file contains 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
# 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
If you use
exec
instead ofscript
, it treats it as a single executable and start/stop/loggings works automaticallyfind logs at
/var/log/upstart/my-prog.log