Skip to content

Instantly share code, notes, and snippets.

@codebrew
Created December 15, 2011 06:33
Show Gist options
  • Save codebrew/1480072 to your computer and use it in GitHub Desktop.
Save codebrew/1480072 to your computer and use it in GitHub Desktop.
upstart script to run a master hookio-server
# Ubuntu upstart file at /etc/init/hookio-server.conf
author "Ryan Fitzgerald <[email protected]>"
env DIR=/var/lib/hookio-server/
env DAEMON=/usr/local/bin/hookio
env LOG_DIR=/var/log/hookio
env NODE_ENV=production
pre-start script
mkdir -p $DIR
mkdir -p $LOG_DIR
end script
start on runlevel [2345]
stop on runlevel [06]
respawn
script
exec start-stop-daemon --start --quiet --chdir $DIR --exec $DAEMON >> $LOG_DIR/hookio-server.log 2>&1
end script
author "Ryan Fitzgerald <[email protected]>"
env DIR=/home/ubuntu/apps/stockroom/
env DAEMON=/home/ubuntu/apps/stockroom/bin/stockroom
env LOG_DIR=/var/log/stockroom
env NODE_ENV=production
pre-start script
mkdir -p $DIR
mkdir -p $LOG_DIR
end script
start on started hookio-server
respawn
script
exec start-stop-daemon --start --quiet --chdir $DIR --exec $DAEMON >> $LOG_DIR/stockroom.log 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment