Created
January 30, 2013 23:18
-
-
Save parshap/4678285 to your computer and use it in GitHub Desktop.
Upstart
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 "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 |
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
CONF1="value" | |
CONF2="value2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment