1 diff -Naur orig.xen-4.1.1//tools/hotplug/Linux/init.d/xencommons xen-4.1.1//tools/hotplug/Linux/init.d/xencommons
2 --- orig.xen-4.1.1//tools/hotplug/Linux/init.d/xencommons 2011-07-03 03:08:44.953747064 -0700
3 +++ xen-4.1.1//tools/hotplug/Linux/init.d/xencommons 2011-07-05 13:47:54.627029164 -0700
5 # Description: Starts and stops the daemons neeeded for xl/xend
11 if [ -d /etc/sysconfig ]; then
12 xencommons_config=/etc/sysconfig
16 test -f $xencommons_config/xencommons && . $xencommons_config/xencommons
18 -XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
19 +XENCONSOLED_PIDFILE=/run/daemons/xenconsoled.pid
22 if test "x$1" = xstart && \
29 # Exit if we timed out
30 if ! [ $time -lt $timeout ] ; then
31 - echo Could not start xenstored
32 + #echo Could not start xenstored
38 - echo Setting domain 0 name...
39 + stat_busy "Setting domain 0 name..."
40 xenstore-write "/local/domain/0/name" "Domain-0"
44 - echo Starting xenconsoled...
45 + #echo Starting xenconsoled...
46 + stat_busy "Starting xenconsoled"
47 test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
48 xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
49 test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d"
50 test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
52 + add_daemon xencommons
55 - echo Stopping xenconsoled
56 + stat_busy "Stopping xenconsoled"
57 if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then
59 while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
60 rm -f $XENCONSOLED_PIDFILE
64 - echo WARNING: Not stopping xenstored, as it cannot be restarted.
65 + printhl "WARNING: Not stopping xenstored, as it cannot be restarted."
66 + rm_daemon xencommons
70 diff -Naur orig.xen-4.1.1//tools/hotplug/Linux/init.d/xend xen-4.1.1//tools/hotplug/Linux/init.d/xend
71 --- orig.xen-4.1.1//tools/hotplug/Linux/init.d/xend 2011-07-03 03:08:44.953747064 -0700
72 +++ xen-4.1.1//tools/hotplug/Linux/init.d/xend 2011-07-05 01:47:40.981951191 -0700
74 # Description: Starts and stops the Xen control daemon.
78 +. /etc/rc.d/functions
83 # Wait for Xend to be up
87 if [ -z "`ps -C xenconsoled -o pid=`" ]; then
88 - echo "xencommons should be started first."
89 + printhl "xencommons should be started first."
92 # mkdir shouldn't be needed as most distros have this already created. Default to using subsys.
93 # See docs/misc/distro_mapping.txt
95 - if [ -d /var/lock/subsys ] ; then
96 - touch /var/lock/subsys/xend
97 + if [ -d /run/lock/subsys ] ; then
98 + touch /run/lock/subsys/xend
100 - touch /var/lock/xend
101 + touch /run/lock/xend
103 + stat_busy "Starting xend"
112 + stat_busy "Stopping xend"
114 - rm -f /var/lock/subsys/xend /var/lock/xend
115 + rm -f /run/lock/xend /var/lock/xend
124 restart|force-reload)
125 + stat_busy "Restarting xend"
131 # do not advertise unreasonable commands that there is no reason
132 diff -Naur orig.xen-4.1.1//tools/hotplug/Linux/init.d/xendomains xen-4.1.1//tools/hotplug/Linux/init.d/xendomains
133 --- orig.xen-4.1.1//tools/hotplug/Linux/init.d/xendomains 2011-07-03 03:08:44.953747064 -0700
134 +++ xen-4.1.1//tools/hotplug/Linux/init.d/xendomains 2011-07-05 13:46:36.208222760 -0700
136 # Description: Start / stop domains automatically when domain 0
137 # boots / shuts down.
140 +. /etc/rc.d/functions
144 $CMD list &> /dev/null
149 -# See docs/misc/distro_mapping.txt
150 -if [ -d /var/lock/subsys ]; then
151 - LOCKFILE=/var/lock/subsys/xendomains
153 - LOCKFILE=/var/lock/xendomains
156 -if [ -d /etc/sysconfig ]; then
157 - XENDOM_CONFIG=/etc/sysconfig/xendomains
159 - XENDOM_CONFIG=/etc/default/xendomains
161 +LOCKFILE=/run/lock/xendomains
162 +XENDOM_CONFIG=/etc/default/xendomains
164 -test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing";
165 +test -r $XENDOM_CONFIG || {
166 + printhl "$XENDOM_CONFIG not existing";
167 if [ "$1" = "stop" ]; then exit 0;
172 -# Use the SUSE rc_ init script functions;
173 -# emulate them on LSB, RH and other systems
174 -if test -e /etc/rc.status; then
175 - # SUSE rc script library
180 - if test "${_cmd}" = "status"; then
183 +if test "${_cmd}" = "status"; then
184 _SMSG=(running dead dead unused unknown)
188 _SMSG=(done failed failed missed failed skipped unused failed failed)
191 - if test -e /etc/init.d/functions; then
193 - . /etc/init.d/functions
196 - #echo -n " [${_SMSG[${_RC_RV}]}] "
197 - if test ${_RC_RV} = 0; then
198 - success " [${_SMSG[${_RC_RV}]}] "
200 - failure " [${_SMSG[${_RC_RV}]}] "
203 - elif test -e /lib/lsb/init-functions; then
205 - . /lib/lsb/init-functions
206 - if alias log_success_msg >/dev/null 2>/dev/null; then
209 - echo " [${_SMSG[${_RC_RV}]}] "
214 - if test ${_RC_RV} = 0; then
215 - log_success_msg " [${_SMSG[${_RC_RV}]}] "
217 - log_failure_msg " [${_SMSG[${_RC_RV}]}] "
225 - echo " [${_SMSG[${_RC_RV}]}] "
228 - rc_reset() { _RC_RV=0; }
237 + printhl "Return Status: ${_SMSG[${_RC_RV}]}"
241 +rc_reset() { _RC_RV=0; }
245 if test -z "$1"; then
248 elif test "$1" != "0"; then
269 if test "$1" = "-r"; then _RC_RV=0; shift; fi
270 if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
271 @@ -140,26 +102,24 @@
272 if test "$1" = "-v"; then echo_rc; shift; fi
273 if test "$1" = "-r"; then _RC_RV=0; shift; fi
276 - rc_exit() { exit ${_RC_RV}; }
282 +rc_exit() { exit ${_RC_RV}; }
286 if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
287 if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
293 -if ! which usleep >&/dev/null
299 - sleep $(( $1 / 1000000 ))
306 + sleep $(( $1 / 1000000 ))
310 # Reset status of this service
312 @@ -235,10 +195,12 @@
315 if [ -f $LOCKFILE ]; then
316 - echo -e "xendomains already running (lockfile exists)"
317 + stat_busy "xendomains already running (lockfile exists)"
322 + printhl "Starting Xen Domains"
324 if [ "$XENDOMAINS_RESTORE" = "true" ] &&
325 contains_something "$XENDOMAINS_SAVE"
330 + add_daemon xendomains
335 if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
338 - echo -n "Shutting down Xen domains:"
339 + printhl "Shutting down Xen domains"
342 parseln "$LN" || continue
347 + rm_daemon xendomains
351 diff -Naur orig.xen-4.1.1//tools/hotplug/Linux/init.d/xen-watchdog xen-4.1.1//tools/hotplug/Linux/init.d/xen-watchdog
352 --- orig.xen-4.1.1//tools/hotplug/Linux/init.d/xen-watchdog 2011-07-03 03:08:44.957080397 -0700
353 +++ xen-4.1.1//tools/hotplug/Linux/init.d/xen-watchdog 2011-07-05 13:20:22.515289867 -0700
359 +. /etc/rc.d/functions
361 DAEMON=/usr/sbin/xenwatchdogd
362 base=$(basename $DAEMON)
363 +initname="xen-watchdog"
365 -# Source function library.
366 -if [ -e /etc/init.d/functions ] ; then
367 - . /etc/init.d/functions
368 -elif [ -e /lib/lsb/init-functions ] ; then
369 - . /lib/lsb/init-functions
387 - echo -n $"Starting domain watchdog daemon: "
388 + stat_busy "Starting domain watchdog daemon"
392 - [ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup"
394 + [ "$r" -eq 0 ] && stat_done ; add_daemon $initname || stat_fail
401 - echo -n $"Stopping domain watchdog daemon: "
402 + stat_busy "Stopping domain watchdog daemon"
404 killall -USR1 $base 2>/dev/null
406 - [ "$r" -eq 0 ] && success $"$base stop" || failure $"$base stop"
408 + [ "$r" -eq 0 ] && stat_done ; rm_daemon $initname || stat_fail