Author: waldi Date: Thu Oct 27 00:03:22 2011 New Revision: 944 Log: * debian/changelog: Update. * debian/xen-utils-common.xend.init - Support xl, aka disable xend if not xm selected. - Add error messages if utils or toolstack not available. Modified: trunk/xen-common/debian/changelog trunk/xen-common/debian/xen-utils-common.xend.init Modified: trunk/xen-common/debian/changelog =============================================================================--- trunk/xen-common/debian/changelog Wed Oct 26 23:43:53 2011 (r943) +++ trunk/xen-common/debian/changelog Thu Oct 27 00:03:22 2011 (r944) @@ -1,6 +1,7 @@ xen-common (4.1.2-2) UNRELEASED; urgency=low * Remove xend wrapper, it should not be called by users. + * Support xl in init script. -- Bastian Blank <waldi at debian.org> Thu, 27 Oct 2011 01:36:30 +0200 Modified: trunk/xen-common/debian/xen-utils-common.xend.init =============================================================================--- trunk/xen-common/debian/xen-utils-common.xend.init Wed Oct 26 23:43:53 2011 (r943) +++ trunk/xen-common/debian/xen-utils-common.xend.init Thu Oct 27 00:03:22 2011 (r944) @@ -9,27 +9,32 @@ # Description: XEN control daemon ### END INIT INFO -PATH=/usr/lib/xen-common/bin:/sbin:/bin:/usr/sbin:/usr/bin +PATH=/sbin:/bin:/usr/sbin:/usr/bin DESC="Xen daemons" -VERSION=$(xen-version) -ROOT=/usr/lib/xen-$VERSION +. /lib/init/vars.sh +. /lib/lsb/init-functions -XEND="$ROOT"/bin/xend +ROOT=$(/usr/lib/xen-common/bin/xen-dir 2>/dev/null) +if [ $? -ne 0 ]; then + log_warning_msg "Not running within Xen or no compatible utils" + exit 0 +fi +TOOLSTACK=$(/usr/lib/xen-common/bin/xen-toolstack 2>/dev/null) +if [ $? -ne 0 ]; then + log_warning_msg "No usable Xen toolstack selected" + exit 0 +fi + +[ -e "$ROOT"/bin/xend ] && XEND="$ROOT"/bin/xend XENCONSOLED="$ROOT"/bin/xenconsoled XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid" XENSTORED="$ROOT"/bin/xenstored XENSTORED_DIR="/var/run/xenstored" XENSTORED_PIDFILE="/var/run/xenstore.pid" -[ "$VERSION" ] || exit 0 -[ -x "$XEND" ] || exit 0 - [ -r /etc/default/xend ] && . /etc/default/xend -. /lib/init/vars.sh -. /lib/lsb/init-functions - modules_setup() { modprobe xenfs 2>/dev/null @@ -54,6 +59,10 @@ xend_start() { + if [ -z "$XEND" ] || [ "$(basename "$TOOLSTACK")" != xm ]; then + return 0 + fi + log_progress_msg "xend" $XEND status && return 1 $XEND start || return 2 @@ -69,6 +78,7 @@ xend_stop() { + [ -z "$XEND" ] && return 0 log_progress_msg "xend" $XEND status || return 0 $XEND stop || return 1