forked from Supervisor/initscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fedora-bmbouter
67 lines (60 loc) · 1.42 KB
/
fedora-bmbouter
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
#
# /etc/rc.d/init.d/supervisord
# supervisord This shell script takes care of starting and stopping
# supervisord. Tested on Fedora 11.
#
# Author: Brian Bouterse bmbouter@gmail.com
#
# chkconfig: 345 80 80
# description: supervisord is a client/server process control system. \
# processname: supervisord
# pidfile: /var/run/supervisord.pid
# Source function library.
. /etc/init.d/functions
DAEMON=/usr/bin/supervisord
PIDFILE=/var/run/supervisord.pid
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
start() {
echo -n "Starting supervisord: "
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
echo supervisord already running: $PID
exit 2;
else
daemon $DAEMON --pidfile=$PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/supervisord
return $RETVAL
fi
}
stop() {
echo -n "Shutting down supervisord: "
echo
killproc -p $PIDFILE supervisord
echo
rm -f /var/lock/subsys/supervisord
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status supervisord
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|status|restart}"
exit 1
;;
esac
exit $?