Created
August 16, 2016 23:43
-
-
Save dieface/ebe10776e5fd388050641e8f6e452e80 to your computer and use it in GitHub Desktop.
Upstart Conf for Node Server - edited in /etc/init/upstart-node-server.conf
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
description "RESTful Server" | |
author "dieface" | |
# When to start the service | |
# used to be: start on startup | |
# until we found some mounts weren't ready yet while booting | |
start on started mountall and runlevel [2345] | |
# When to stop the service | |
stop on shutdown | |
# Automatically restart process if crashed | |
respawn | |
respawn limit 10 5 | |
# drop root proviliges and switch to mymetorapp user | |
setuid ubuntu | |
setgid ubuntu | |
chdir /home/ubuntu/apps/production-rest | |
# we don't use buil-in log because we use a script below | |
# console log | |
script | |
exec /home/ubuntu/.nvm/versions/node/v5.2.0/bin/npm run upstart >> /home/ubuntu/production-rest.log 2>&1 | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remember to specify node with path in script in package.json