Skip to content

Instantly share code, notes, and snippets.

@AmarPrabhu
Created February 12, 2016 12:32
Show Gist options
  • Save AmarPrabhu/a5ab6d91fbb8ee42fd17 to your computer and use it in GitHub Desktop.
Save AmarPrabhu/a5ab6d91fbb8ee42fd17 to your computer and use it in GitHub Desktop.
ghost upstart service
#/etc/init/ghost.conf
description "Ghost Blog"
author "Your Name"
# Start the service after everything loaded
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
# Automatically restart service
respawn
respawn limit 99 5
script
# Navigate to your app directory
cd /var/www/ghost/
# Run the script with Node.js and output to a log
su ghost -c "/usr/local/bin/npm start --production" 2>&1 >> /var/log/ghost.log
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment