-
Notifications
You must be signed in to change notification settings - Fork 0
/
panoptes_monitor.init.in
executable file
·69 lines (63 loc) · 1.26 KB
/
panoptes_monitor.init.in
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
68
69
#!/bin/bash
#
# panoptes_monitor Startup script for panoptes monitor
#
# chkconfig: - 85 15
# description: The monitor component of panoptes
# processname: panoptes_monitor
# config: /etc/panoptes_config.xml
# pidfile: /var/run/panoptes_monitor.pid
#
### BEGIN INIT INFO
# Provides: panoptes_monitor
# Required-Start: $local_fs $remote_fs $network $named
# Required-Stop: $local_fs $remote_fs $network
# Short-Description: start and stop panoptes_monitor
# Description: The monitor component of panoptes
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
prog=SBINDIR/panoptes_monitor
pidfile=/var/run/panoptes_monitor.pid
RETVAL=0
start() {
echo -n $"Starting $prog: "
daemon $prog
RETVAL=$?
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile} -d 10 $prog
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${pidfile}
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p ${pidfile} $prog
RETVAL=$?
;;
restart)
stop
start
;;
condrestart|try-restart)
if status -p ${pidfile} $prog >&/dev/null; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|help}"
RETVAL=2
esac
exit $RETVAL