Author: waldi Date: Sun Nov 15 15:57:41 2009 New Revision: 674 Log: * debian/changelog: Update. * debian/xen-utils-common.xend.init - Load modules. - Mount xenfs. 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 Sun Nov 15 15:18:51 2009 (r673) +++ trunk/xen-common/debian/changelog Sun Nov 15 15:57:41 2009 (r674) @@ -3,6 +3,7 @@ * New upstream version. * Check for correct hypervisor type. * Fix xend stop. (closes: #555902) + * Load modules and setup xenfs in xend init script. -- Bastian Blank <waldi at debian.org> Sun, 23 Aug 2009 13:07:18 +0200 Modified: trunk/xen-common/debian/xen-utils-common.xend.init =============================================================================--- trunk/xen-common/debian/xen-utils-common.xend.init Sun Nov 15 15:18:51 2009 (r673) +++ trunk/xen-common/debian/xen-utils-common.xend.init Sun Nov 15 15:57:41 2009 (r674) @@ -24,14 +24,40 @@ test "$VERSION" || exit 0 test -x "$XEND" || exit 0 -test -e /proc/xen/privcmd || exit 0 -grep -q "control_d" /proc/xen/capabilities || exit 0 [ -r /etc/default/xend ] && . /etc/default/xend . /lib/init/vars.sh . /lib/lsb/init-functions +modules_setup() +{ + modprobe xenfs 2>/dev/null + modprobe evtchn 2>/dev/null +} + +modules_setup_control() +{ + modprobe blkbk 2>/dev/null + modprobe netbk 2>/dev/null +} + +xenfs_setup() +{ + [ "$(awk ''($2 == "/proc/xen") { print $2 }'' /proc/mounts)" ] && return 0 + log_progress_msg "xenfs" + [ -d "/proc/xen" ] || return 1 + mount -t xenfs xenfs /proc/xen || return 1 + return 0 +} + +capability_check() +{ + [ -d "/proc/xen" ] || return 1 + grep -q "control_d" /proc/xen/capabilities || return 1 + return 0 +} + xend_start() { log_progress_msg "xend" @@ -78,33 +104,41 @@ case "$1" in start) log_daemon_msg "Starting $DESC" + modules_setup + xenfs_setup + case "$?" in + 0) ;; + *) log_end_msg 1; exit ;; + esac + capability_check + case "$?" in + 0) ;; + *) log_end_msg 255; exit ;; + esac + modules_setup_control xenstored_start case "$?" in 0|1) ;; - *) - log_end_msg 1 - exit - ;; + *) log_end_msg 1; exit ;; esac xenconsoled_start case "$?" in 0|1) ;; - *) - log_end_msg 1 - exit - ;; + *) log_end_msg 1; exit ;; esac xend_start case "$?" in 0|1) ;; - *) - log_end_msg 1 - exit - ;; + *) log_end_msg 1; exit ;; esac log_end_msg 0 ;; stop) + capability_check + case "$?" in + 0) ;; + *) exit ;; + esac log_daemon_msg "Stopping $DESC" xend_stop case "$?" in @@ -113,6 +147,11 @@ esac ;; restart|force-reload) + capability_check + case "$?" in + 0) ;; + *) exit ;; + esac log_daemon_msg "Restarting $DESC" xend_stop case "$?" in