-
-
Save kcollasarundell/8175743 to your computer and use it in GitHub Desktop.
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
#!upstart | |
# An example upstart script for running the ghost blog as a daemon with | |
# logging and process management via upstart | |
# You will need to set the environment variables noted below to conform to | |
# your use case, and should change the description. | |
description "GHOST blog" | |
start on startup | |
stop on shutdown | |
env APPLICATION_DIRECTORY="/var/www/blog/ghost" | |
env NODE_ENV=production | |
env USER=ghost | |
env GROUP=ghost | |
export NODE_ENV=production | |
# configure the logging | |
# logs to /var/log/upstart/ghost.log | |
console log | |
#run as | |
setuid $USER | |
setgid $GROUP | |
chdir $APPLICATION_DIRECTORY | |
# Instead of using forever upstart can manage the restarting of your node stuff | |
# If the process dies on startup it will try and restart it 10 times over 5 seconds. | |
respawn | |
script | |
exec npm start | |
end script | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment