Skip to content

Instantly share code, notes, and snippets.

@swinton
Created March 5, 2012 15:44
Show Gist options
  • Save swinton/1978897 to your computer and use it in GitHub Desktop.
Save swinton/1978897 to your computer and use it in GitHub Desktop.
Example of an upstart job running a python script under a virtualenv
########################################
##### upstart_virtualenv_test.conf #####
##### install in /etc/init #####
########################################
description "Testing virtualenv and upstart setup"
env PYTHON_HOME=/home/steve/.virtualenvs/upstart-test
start on runlevel [2345]
stop on runlevel [!2345]
exec $PYTHON_HOME/bin/python /usr/local/bin/upstart_virtualenv_test.py >> /var/log/upstart_virtualenv_test/upstart_virtualenv_test.log 2>&1
respawn
respawn limit 10 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment