Search
j0ke.net Open Build Service
>
Projects
>
virtualization
:
xen
:
redhat
:
3.4.0
>
xen
> xen-3.4.0-initscripts.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File xen-3.4.0-initscripts.patch of Package xen
--- xen-3.4.0.orig/tools/hotplug/Linux/init.d/xend 2009-05-18 13:05:38.000000000 +0200 +++ xen-3.4.0/tools/hotplug/Linux/init.d/xend 2009-05-23 14:34:29.000000000 +0200 @@ -6,55 +6,80 @@ # # 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 + +RETVAL=0 +if [ ! -d /proc/xen ]; then + exit 0 +fi if ! grep -q "control_d" /proc/xen/capabilities ; then exit 0 fi +prog=xend + +XENCONSOLED_LOG_HYPERVISOR=no +XENCONSOLED_LOG_GUESTS=no +XENCONSOLED_TIMESTAMP_HYPERVISOR_LOG=no +XENCONSOLED_TIMESTAMP_GUEST_LOG=no +XENCONSOLED_LOG_DIR=/var/log/xen/console + +test -f /etc/sysconfig/xend && . /etc/sysconfig/xend # Wait for Xend to be up function await_daemons_up { i=1 rets=10 - xend status + /usr/sbin/xend status while [ $? -ne 0 -a $i -lt $rets ]; do sleep 1 echo -n . i=$(($i + 1)) - xend status + /usr/sbin/xend status done + if [ $i -ge $rets ]; then + RETVAL=-1 + return 1 + fi + return 0 } case "$1" in start) - touch /var/lock/subsys/xend - xend start + echo -n $"Starting $prog: " + modprobe blkbk + modprobe blktap + modprobe netbk + modprobe netloop + + export XENCONSOLED_LOG_DIR + export XENCONSOLED_LOG_GUESTS + export XENCONSOLED_LOG_HYPERVISOR + export XENCONSOLED_TIMESTAMP_HYPERVISOR_LOG + export XENCONSOLED_TIMESTAMP_GUEST_LOG + + /usr/sbin/xend start await_daemons_up ;; stop) - xend stop - rm -f /var/lock/subsys/xend + echo -n $"Stopping $prog: " + /usr/sbin/xend stop + RETVAL=$? ;; status) - xend status + /usr/sbin/xend status + if [ $? = 0 ] ; then + echo xend is running + else + echo xend is stopped + fi + exit 0 ;; - reload) - xend reload - ;; - restart|force-reload) - xend restart + restart|reload|force-reload) + echo -n $"$1 $prog: " + /usr/sbin/xend restart await_daemons_up ;; *) @@ -64,5 +89,12 @@ exit 1 esac -exit $? +if [ $RETVAL = 0 ] ; then + echo_success + echo +else + echo_failure + echo +fi +exit $RETVAL