uwsgi-SLES-dist
988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# chkconfig: - 85 15
# description: Use uwsgi to run python and wsgi web apps.
# processname: uwsgi
UWSGI_BIN="<UWSGI_VE32_PATH>/bin/uwsgi"
UWSGI_OPTIONS="--ini <UWSGI_VE32_PATH>/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