Skip to content

Instantly share code, notes, and snippets.

@dsoike
Last active June 19, 2017 20:51
Show Gist options
  • Save dsoike/15017119f96d6df087b9c80f41c98ed6 to your computer and use it in GitHub Desktop.
Save dsoike/15017119f96d6df087b9c80f41c98ed6 to your computer and use it in GitHub Desktop.
Upstart Script for Otto Server
# 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