Author: waldi Date: Wed Aug 23 11:13:40 2006 New Revision: 273 Modified: trunk/xen-common/debian/xen-utils-common.xend.init Log: debian/xen-utils-common.xend.init: Use computed name for xend. Modified: trunk/xen-common/debian/xen-utils-common.xend.init =============================================================================--- trunk/xen-common/debian/xen-utils-common.xend.init (original) +++ trunk/xen-common/debian/xen-utils-common.xend.init Wed Aug 23 11:13:40 2006 @@ -1,11 +1,15 @@ -#! /bin/sh +#!/bin/sh -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/xend +set -e + +PATH=/usr/lib/xen-common/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=xend DESC=XEN XENSTORED_RUN_DIR="/var/run/xenstored" +ROOT=$(xen-utils-root -q || true) +DAEMON=$ROOT/bin/xend +test "$ROOT" || exit 0 test -x $DAEMON || exit 0 test -e /proc/xen/privcmd || exit 0 grep -q "control_d" /proc/xen/capabilities || exit 0 @@ -14,12 +18,12 @@ await_daemons_up () { i=1 rets=10 - xend status + $DAEMON status while [ $? -ne 0 -a $i -lt $rets ]; do sleep 1 echo -n . i=$(($i + 1)) - xend status + $DAEMON status done } @@ -30,18 +34,18 @@ start) echo -n "Starting $DESC: " [ -d "$XENSTORED_RUN_DIR" ] || mkdir -p "$XENSTORED_RUN_DIR" - xend start + $DAEMON start await_daemons_up echo "$NAME." ;; stop) echo -n "Stopping $DESC: " - xend stop + $DAEMON stop echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " - xend restart + $DAEMON restart await_daemons_up echo "$NAME." ;;