Last active
December 18, 2015 12:09
-
-
Save rudyryk/5780677 to your computer and use it in GitHub Desktop.
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
# MyApp UpStart script template | |
description "MyApp python server" | |
start on startup | |
stop on shutdown | |
respawn | |
# It's a good idea to setup LANG | |
env LANG=en_US.UTF-8 | |
env USER=myuser | |
env COMMAND=/home/myuser/.virtualenvs/myapp/bin/python | |
env COMMAND_ARGS='manage.py serve' | |
env CHDIR=/home/myuser/myapp | |
env LOG_STDOUT=/var/log/myapp.log | |
env LOG_STDERR=/var/log/myapp-errors.log | |
script | |
chdir $CHDIR | |
exec sudo -u $USER $COMMAND $COMMAND_ARGS >>$LOG_STDOUT 2>>$LOG_STDERR | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment