]>
Commit | Line | Data |
---|---|---|
2e8b91a6 JR |
1 | #!/bin/sh |
2 | # | |
3 | # xen-watchdog Run XEN domain watchdog daemon | |
4 | # | |
5 | # chkconfig: 2345 21 79 | |
6 | # description: Run XEN domain watchdog daemon | |
7 | # processname: xenwatchdogd | |
8 | # | |
9 | ### BEGIN INIT INFO | |
10 | # Provides: xen-watchdog | |
11 | # Required-Start: $syslog $remote_fs | |
12 | # Should-Start: xend | |
13 | # Required-Stop: $syslog $remote_fs | |
14 | # Should-Stop: xend | |
15 | # Default-Start: 2 3 4 5 | |
16 | # Default-Stop: 0 1 6 | |
17 | # Short-Description: Start/stop xen-watchdog | |
18 | # Description: Run XEN domain watchdog daemon. | |
19 | ### END INIT INFO | |
20 | # | |
21 | ||
22 | # Source function library. | |
23 | . /etc/rc.d/init.d/functions | |
24 | ||
25 | start() { | |
26 | if [ -f /var/lock/subsys/xen-watchdog ]; then | |
27 | msg_already_running "XEN domain watchdog daemon" | |
28 | return | |
29 | fi | |
30 | msg_starting "XEN domain watchdog daemon" | |
31 | ||
32 | /usr/sbin/xenwatchdogd 30 15 | |
33 | RETVAL=$? | |
34 | if [ $RETVAL -ne 0 ]; then | |
35 | return 7 | |
36 | fi | |
37 | touch /var/lock/subsys/xen-watchdog | |
38 | } | |
39 | ||
40 | stop() { | |
41 | if [ ! -f /var/lock/subsys/xen-watchdog ]; then | |
42 | msg_not_running "XEN domain watchdog daemon" | |
43 | return | |
44 | fi | |
45 | msg_stopping "XEN domain watchdog daemon" | |
46 | ||
47 | killproc xenwatchdogd -USR1 | |
48 | RETVAL=$? | |
49 | rm -f /var/lock/subsys/xen-watchdog | |
50 | } | |
51 | ||
52 | RETVAL=0 | |
53 | # See how we were called. | |
54 | case "$1" in | |
55 | start) | |
56 | start | |
57 | ;; | |
58 | stop) | |
59 | stop | |
60 | ;; | |
61 | restart) | |
62 | stop | |
63 | start | |
64 | ;; | |
65 | status) | |
66 | status xenwatchdogd | |
67 | ;; | |
68 | condrestart) | |
69 | stop | |
70 | start | |
71 | ;; | |
72 | *) | |
73 | msg_usage "$0 {start|stop|status|restart|condrestart}" | |
74 | exit 3 | |
75 | esac | |
76 | ||
77 | exit $RETVAL |