Skip to content

Instantly share code, notes, and snippets.

@mammadori
Forked from parente/runinenv.sh
Created April 26, 2012 15:19
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 mammadori/2500311 to your computer and use it in GitHub Desktop.
Save mammadori/2500311 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_path] CMDS"
exit 1
fi
. ${VENV}/bin/activate
shift 1
echo "Executing $@ in ${VENV}"
exec "$@"
deactivate
; rest of conf omitted for brevity
[program:handlerbag]
command=sh runinenv /opt/envs/handlerbag 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