Skip to content

Instantly share code, notes, and snippets.

@mikebarnhardt
Created January 22, 2016 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebarnhardt/26603105e66c7cf537d0 to your computer and use it in GitHub Desktop.
Save mikebarnhardt/26603105e66c7cf537d0 to your computer and use it in GitHub Desktop.
Service Script for Node Apps
description "Site Name"
author "Your Name"
# Start service after everything loaded
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
# Automatically restart service
respawn
respawn limit 3 15
script
# Navigate to app directory
cd /var/www/citizen/
# Run the script with nodejs
exec sudo -u nodejs NODE_ENV=production /usr/bin/nodejs index.js
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment