forked from marmarek/old-qubes-vmm-xen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.xenconsoled
executable file
·121 lines (109 loc) · 2.53 KB
/
init.xenconsoled
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/bash
#
# xenconsoled Script to start and stop the Xen xenconsoled daemon
#
# Author: Daniel P. Berrange <[email protected]>
#
# chkconfig: 2345 97 01
# description: Starts and stops the Xen control daemon.
### BEGIN INIT INFO
# Provides: xenconsoled
# Required-Start: $syslog $remote_fs
# Should-Start:
# Required-Stop: $syslog $remote_fs xenstored
# Should-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Default-Enabled: yes
# Short-Description: Start/stop xenconsoled
# Description: Starts and stops the Xen xenconsoled 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
XENCONSOLED_LOG_HYPERVISOR=no
XENCONSOLED_LOG_GUESTS=no
XENCONSOLED_LOG_DIR=/var/log/xen/console
XENCONSOLED_ARGS=
# User customized params
test -f /etc/sysconfig/xenconsoled && . /etc/sysconfig/xenconsoled
XENCONSOLED_LOG=none
if [ "$XENCONSOLED_LOG_HYPERVISOR" = "yes" ]
then
if [ "$XENCONSOLED_LOG_GUESTS" = "yes" ]
then
XENCONSOLED_LOG=all
else
XENCONSOLED_LOG=hv
fi
else
if [ "$XENCONSOLED_LOG_GUESTS" = "yes" ]
then
XENCONSOLED_LOG=guest
fi
fi
start() {
echo -n $"Starting xenconsoled daemon: "
/usr/sbin/xenconsoled --log=$XENCONSOLED_LOG --log-dir=$XENCONSOLED_LOG_DIR $XENCONSOLED_ARGS
RETVAL=$?
test $RETVAL = 0 && echo_success || echo_failure
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/xenconsoled
}
stop() {
echo -n $"Stopping xenconsoled daemon: "
killproc xenconsoled > /dev/null
RETVAL=$?
test $RETVAL = 0 && echo_success || echo_failure
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/xenconsoled
}
rcstatus() {
status xenconsoled
RETVAL=$?
test $RETVAL = 0 && echo_success || echo_failure
echo
}
reload() {
echo -n $"Reloading xenconsoled daemon: "
killproc xenconsoled -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/xenconsoled ]
then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
exit 1
esac
exit $RETVAL