Skip to content

Instantly share code, notes, and snippets.

@christianschmizz
Forked from parente/runinenv.sh
Created March 11, 2012 19:44
Show Gist options
  • Save christianschmizz/2017820 to your computer and use it in GitHub Desktop.
Save christianschmizz/2017820 to your computer and use it in GitHub Desktop.
run a command in virtualenv, useful for supervisord
#!/bin/bash
VENV=$1
if [ -z $VENV ]; then
echo "usage: runinenv [virtualenv] CMDS"
exit 1
fi
. ${WORKON_HOME}/${VENV}/bin/activate
shift 1
echo "Executing $@ in ${VENV}"
exec "$@"
deactivate
; rest of conf omitted for brevity
[program:handlerbag]
command=sh runinenv handlerbagenv handlerbag.py --port=5000
directory=/opt/envs/handlerbag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment