Last active
June 19, 2017 20:51
-
-
Save dsoike/15017119f96d6df087b9c80f41c98ed6 to your computer and use it in GitHub Desktop.
Upstart Script for Otto Server
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
# Upstart Script for Otto Server | |
# - file location: /etc/init/otto-server.conf | |
description "otto-server" | |
start on started mountall | |
stop on shutdown | |
# Automatically Respawn | |
respawn | |
respawn limit 99 5 | |
# Environment Variables | |
env NODE_ENV=development | |
# Script to Start Server | |
# - Referencing 'npm' from Node Version Manager (NVM) install location. | |
script | |
cd /home/ec2-user/otto-server | |
exec /home/ec2-user/.nvm/versions/node/v4.4.5/bin/npm start >> /var/log/otto-server.log 2>&1 | |
end script | |
# Usage | |
# - Now you can start/stop the otto-server with `sudo start otto-server` and `sudo stop otto-server` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment