forked from vhostmd/vhostmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrcvhostmd
executable file
·64 lines (57 loc) · 1.39 KB
/
rcvhostmd
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
#!/bin/sh
# the following is the LSB init header see
# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-generic.html#INITSCRCOMCONV
#
### BEGIN INIT INFO
# Provides: vhostmd
# Required-Start:
# Should-Start: xend
# Default-Start: 3 5
# Required-Stop:
# Should-Stop: xend
# Default-Stop: 0 1 2 4 6
# Short-Description: daemon for virtualization metrics
# Description: This is a daemon for gathering VM metrics
### END INIT INFO
VHOSTMD_BIN=/usr/sbin/vhostmd
test -x $VHOSTMD_BIN || { echo "$VHOSTMDBIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
. /etc/rc.status
rc_reset
case "$1" in
start)
echo -n "Starting vhostmd "
startproc $VHOSTMD_BIN
rc_status -v
;;
stop)
echo -n "Shutting down vhostmd "
killproc -TERM $VHOSTMD_BIN > /dev/null 2>&1
rc_status -v
;;
try-restart)
$0 status >/dev/null && $0 restart
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
reload)
killproc -HUP $VHOSTMD_BIN
rc_status -v
;;
status)
echo -n "Checking status of vhostmd "
checkproc $VHOSTMD_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|reload|status}"
rc_failed 2
rc_exit
;;
esac
rc_exit