Created
September 14, 2015 01:43
-
-
Save yusufhm/c547f2f9248416c54285 to your computer and use it in GitHub Desktop.
NPM Upstart Script
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 "Turn `project name` bot into a daemon" | |
author "Yusuf Hasan Miyan" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
script | |
echo $$ > /var/run/project-name-bot.pid | |
chdir /path/to/project-name-bot | |
exec sudo -u $user /usr/bin/npm start | |
end script | |
pre-stop script | |
rm /var/run/project-name-bot.pid | |
end script | |
respawn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment