From 5c18f709775df7dfd8dfa34a92dfa92df14de834 Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Thu, 21 Oct 2004 14:13:48 +0000 Subject: [PATCH] bitkeeper revision 1.1159.122.1 (4177c41conAxvsSnGCUYzYBlBVfqCQ) Fix init.d/xendomains. --- tools/examples/Makefile | 2 ++ tools/examples/init.d/xendomains | 16 ++++++++++++---- tools/python/xen/xm/shutdown.py | 5 +++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tools/examples/Makefile b/tools/examples/Makefile index 811a687241..1e77f89d50 100644 --- a/tools/examples/Makefile +++ b/tools/examples/Makefile @@ -1,6 +1,7 @@ # Init scripts. XEND_INITD = init.d/xend +XENDOMAINS_INITD = init.d/xendomains # Xen configuration dir and configs to go there. XEN_CONFIG_DIR = /etc/xen @@ -22,6 +23,7 @@ install: all install-initd install-configs install-scripts install-initd: install -d $(prefix)/etc/init.d install -m0755 $(XEND_INITD) $(prefix)/etc/init.d + install -m0755 $(XENDOMAINS_INITD) $(prefix)/etc/init.d install-configs: install -d $(prefix)$(XEN_CONFIG_DIR) diff --git a/tools/examples/init.d/xendomains b/tools/examples/init.d/xendomains index 41524e6f57..c52c3cc0e9 100755 --- a/tools/examples/init.d/xendomains +++ b/tools/examples/init.d/xendomains @@ -17,7 +17,7 @@ RETVAL=0 -INITD=/etc/init.d/ +INITD=/etc/init.d AUTODIR=/etc/xen/auto LOCKFILE=/var/lock/subsys/xendomains @@ -36,7 +36,7 @@ if [ -e /lib/lsb ]; then log_failure_msg fi } -else +elif [ -r $INITD/functions ]; then # assume a Redhat-like distro . $INITD/functions # source Redhat functions @@ -48,6 +48,14 @@ else failure fi + echo + } +else + # none of the above + LOCKFILE=/var/lock/xendomains + + on_fn_exit() + { echo } fi @@ -66,7 +74,7 @@ start() { # Create all domains with config files in AUTODIR. for dom in $AUTODIR/*; do - xm create --quiet --defaults $dom + xm create --quiet --defconfig $dom if [ $? -ne 0 ]; then RETVAL=$? fi @@ -86,7 +94,7 @@ stop() echo -n $"Shutting down all Xen domains:" - xm shutdown --all --wait --norestart + xm shutdown --all --wait --halt RETVAL=$? diff --git a/tools/python/xen/xm/shutdown.py b/tools/python/xen/xm/shutdown.py index 73324ddd40..39ec78357d 100644 --- a/tools/python/xen/xm/shutdown.py +++ b/tools/python/xen/xm/shutdown.py @@ -46,7 +46,7 @@ def shutdown(opts, doms, mode, wait): server.xend_domain_shutdown(d, mode) if wait: while doms: - alive = domains() + alive = server.xend_domains() dead = [] for d in doms: if d in alive: continue @@ -73,7 +73,8 @@ def shutdown_mode(opts): return mode def main_all(opts, args): - shutdown(opts, None, opts.vals.wait) + mode = shutdown_mode(opts) + shutdown(opts, None, mode, opts.vals.wait) def main_dom(opts, args): if len(args) < 1: opts.err('Missing domain') -- 2.39.5