updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / uwsgi-vhosts / uwsgi.rcd
blobe84e60cc76cc486ea0e92057a8e734e96c0b84b1
1 #!/bin/bash
2 # uwsgi init script for Arch linux
4 # editable settings are in /etc/conf.d/uwsgi
6 . /etc/conf.d/uwsgi
7 . /etc/rc.conf
8 . /etc/rc.d/functions
10 case "$1" in
11 start)
12 stat_busy "Starting uwsgi"
13 $START_COMMAND
14 if [ $? -ne 0 ]; then
15 stat_fail
16 else
17 add_daemon uwsgi
18 stat_done
21 stop)
22 stat_busy "Stopping uwsgi"
23 PID=$(cat $UWSGI_PID)
24 kill -QUIT $PID &>/dev/null
25 if [ $? -ne 0 ]; then
26 stat_fail
27 else
28 for i in `seq 1 10`; do
29 [ -d /proc/$PID ] || { stat_done; rm_daemon uwsgi; rm $UWSGI_PID; exit 0; }
30 sleep 1
31 done
32 # fail if we reach this
33 stat_fail
36 restart)
37 $0 stop
38 sleep 1
39 $0 start
42 echo "usage: $0 {start|stop|restart}"
43 esac