#!/bin/bash # chkconfig: - 85 15 # description: Use uwsgi to run python and wsgi web apps. # processname: uwsgi UWSGI_BIN="/bin/uwsgi" UWSGI_OPTIONS="--ini /src/uWSGI/production.ini" test -x $UWSGI_BIN || { echo "$UWSGI_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } UWSGI_PID=/var/run/uwsgi.pid . /etc/rc.status rc_reset case "$1" in start) echo -n "Starting uwsgi " sleep 2 /sbin/startproc -p $UWSGI_PID $UWSGI_BIN $UWSGI_OPTIONS rc_status -v ;; stop) echo -n "Shutting down uwsgi " /sbin/killproc -p $UWSGI_PID $UWSGI_BIN rc_status -v ;; restart) $0 stop $0 start rc_status ;; status) echo -n "Checking for service uwsgi " /sbin/checkproc -p $UWSGI_PID $UWSGI_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac rc_exit