sintonia/python_apps/pypo/install/pypo-daemontools.sh
martin 079878e5f0 CC-2016: Rearrange python scripts for reusability
-Added api_client to PYTHONPATH env variable
2011-03-24 00:35:01 -04:00

18 lines
480 B
Bash

#!/bin/sh
pypo_user="pypo"
export HOME="/home/pypo/"
# Location of pypo_cli.py Python script
pypo_path="/opt/pypo/bin/"
api_client_path="/opt/pypo/"
pypo_script="pypo-cli.py"
echo "*** Daemontools: starting daemon"
cd ${pypo_path}
exec 2>&1
PYTHONPATH=${api_client_path}:$PYTHONPATH
export PYTHONPATH
# Note the -u when calling python! we need it to get unbuffered binary stdout and stderr
exec setuidgid ${pypo_user} \
python -u ${pypo_path}${pypo_script}
# EOF