Skip to content

Instantly share code, notes, and snippets.

@parshap
Created January 30, 2013 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parshap/4678285 to your computer and use it in GitHub Desktop.
Save parshap/4678285 to your computer and use it in GitHub Desktop.
Upstart
description "app"
author "me"
env APP_DIR=/srv/app
env APP_PATH=/srv/app/bin/app
env LOG_PATH=/var/log/app.log
env CONF_PATH=/etc/app.conf
start on startup
stop on shutdown
script
chdir $APP_DIR
exec bash -c "
set -a
. $CONF_PATH
$APP_PATH
" >> $LOG_PATH 2>&1
end script
# Add log when starting
pre-start script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" \
>> $LOG_PATH 2>&1
end script
CONF1="value"
CONF2="value2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment