#!/bin/bash ### BEGIN INIT INFO # Provides: pserve # Required-Start: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the pserve server # Description: starts pserve ### END INIT INFO DESC="Mozilla Sync Server" PROJECT=/home/XXXX/syncserver/syncserver VIRTUALENV=/home/XXXX/syncserver/syncserver PID_DIR=/home/XXXX/syncserver/syncserver PID_FILE=/home/XXXX/syncserver/syncserver/syncserver.pid LOG_FILE=/home/XXXX/syncserver/syncserver/logs/syncserver.log USER=root GROUP=root PROD_FILE=/home/XXXX/syncserver/syncserver/syncserver.ini source $VIRTUALENV/local/bin/activate cd $PROJECT case "$1" in start) pserve --daemon --pid-file=$PID_FILE --log-file=$LOG_FILE \ --user=$USER --group=$GROUP $PROD_FILE start ;; stop) pserve --daemon --pid-file=$PID_FILE --log-file=$LOG_FILE \ --user=$USER --group=$GROUP $PROD_FILE stop ;; restart) pserve --daemon --pid-file=$PID_FILE --log-file=$LOG_FILE \ --user=$USER --group=$GROUP $PROD_FILE restart ;; status) pserve --daemon --pid-file=$PID_FILE --log-file=$LOG_FILE \ --user=$USER --group=$GROUP status ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 esac exit $RET_VAL