Created
January 22, 2016 16:34
-
-
Save mikebarnhardt/26603105e66c7cf537d0 to your computer and use it in GitHub Desktop.
Service Script for Node Apps
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 "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