stacktach/worker/stacktach.sh
2013-01-25 16:02:52 -05:00

27 lines
524 B
Bash
Executable File

#!/bin/bash
WORKDIR=/root/stacktach
DAEMON=/usr/bin/python
ARGS=$WORKDIR/worker/start_workers.py
PIDFILE=/var/run/stacktach.pid
export DJANGO_SETTINGS_MODULE="settings"
case "$1" in
start)
echo "Starting server"
cd $WORKDIR
/sbin/start-stop-daemon --start --pidfile $PIDFILE --make-pidfile -b --exec $DAEMON $ARGS
;;
stop)
echo "Stopping server"
/sbin/start-stop-daemon --stop --pidfile $PIDFILE --verbose
;;
*)
echo "Usage: stacktach.sh {start|stop}"
exit 1
;;
esac
exit 0