-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmond.init
55 lines (48 loc) · 1.16 KB
/
tmond.init
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
#!/bin/sh
### BEGIN INIT INFO
# Provides: tmond
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The client for the tMon daemon
# Description: The client for the tMon daemon.
### END INIT INFO
# chkconfig: 345 77 77
# description: tmond is the daemon part of the tmon suite. tmon can be used \
# for remote resource monitoring on large networks.
# PID file: /var/run/tmond.pid
# Lock file: /var/lock/tmond.lock
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/local/sbin/tmond
LOCK=/var/lock/tmond.lock
PIDFILE=/var/run/tmond.pid
. /lib/lsb/init-functions
# See how we were called.
case "$1" in
start)
log_daemon_msg "Starting resource monitor daemon" "tmond"
start_daemon -p ${PIDFILE} ${DAEMON}
log_end_msg $?
touch ${LOCK}
;;
stop)
log_daemon_msg "Stopping resource monitor daemon" "tmond"
killproc -p $PIDFILE ${DAEMON}
log_end_msg $?
rm -f ${LOCK}
rm -f ${PIDFILE}
;;
force-reload|restart)
$0 stop
$0 start
;;
status)
status_of_proc -p $PIDFILE $DAEMON tmond && exit 0 || exit $?
;;
*)
echo "Usage: tmond {start|stop|restart|status|force-reload}"
exit 1
esac
exit 0