forked from marmarek/old-qubes-vmm-xen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.xend
executable file
·97 lines (88 loc) · 1.8 KB
/
init.xend
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
#
# xend Script to start and stop the Xen control daemon.
#
# Author: Keir Fraser <[email protected]>
#
# chkconfig: 2345 98 01
# description: Starts and stops the Xen control daemon.
### BEGIN INIT INFO
# Provides: xend
# Required-Start: $syslog $remote_fs
# Should-Start:
# Required-Stop: $syslog $remote_fs
# Should-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Default-Enabled: yes
# Short-Description: Start/stop xend
# Description: Starts and stops the Xen control daemon.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
if [ ! -d /proc/xen ]; then
exit 0
fi
if ! grep -q "control_d" /proc/xen/capabilities ; then
exit 0
fi
# Default config params
start() {
echo -n $"Starting xend daemon: "
/usr/sbin/xend
RETVAL=$?
test $RETVAL = 0 && echo_success || echo_failure
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/xend
}
stop() {
echo -n $"Stopping xend daemon: "
killproc xend > /dev/null
RETVAL=$?
test $RETVAL = 0 && echo_success || echo_failure
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/xend
}
rcstatus() {
status xend
RETVAL=$?
test $RETVAL = 0 && echo_success || echo_failure
echo
}
reload() {
echo -n $"Reloading xend daemon: "
killproc xend -HUP > /dev/null
RETVAL=$?
test $RETVAL = 0 && echo_success || echo_failure
echo
}
RETVAL=0
case "$1" in
start)
start
;;
stop)
stop
;;
status)
rcstatus
;;
reload)
reload
;;
restart|force-reload)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/xend ]
then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
exit 1
esac
exit $RETVAL