Skip to content

Instantly share code, notes, and snippets.

@kcollasarundell
Forked from jeffgca/ghost_upstart.conf
Last active January 1, 2016 17:09
Show Gist options
  • Save kcollasarundell/8175743 to your computer and use it in GitHub Desktop.
Save kcollasarundell/8175743 to your computer and use it in GitHub Desktop.
#!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