ia64/xen-unstable
changeset 2688:ef89e79d3deb
bitkeeper revision 1.1159.122.1 (4177c41conAxvsSnGCUYzYBlBVfqCQ)
Fix init.d/xendomains.
Fix init.d/xendomains.
author | cl349@freefall.cl.cam.ac.uk |
---|---|
date | Thu Oct 21 14:13:48 2004 +0000 (2004-10-21) |
parents | 7bc73b540515 |
children | bd272fb0c28f 82d4a403106d |
files | tools/examples/Makefile tools/examples/init.d/xendomains tools/python/xen/xm/shutdown.py |
line diff
1.1 --- a/tools/examples/Makefile Thu Oct 21 13:47:32 2004 +0000 1.2 +++ b/tools/examples/Makefile Thu Oct 21 14:13:48 2004 +0000 1.3 @@ -1,6 +1,7 @@ 1.4 1.5 # Init scripts. 1.6 XEND_INITD = init.d/xend 1.7 +XENDOMAINS_INITD = init.d/xendomains 1.8 1.9 # Xen configuration dir and configs to go there. 1.10 XEN_CONFIG_DIR = /etc/xen 1.11 @@ -22,6 +23,7 @@ install: all install-initd install-confi 1.12 install-initd: 1.13 install -d $(prefix)/etc/init.d 1.14 install -m0755 $(XEND_INITD) $(prefix)/etc/init.d 1.15 + install -m0755 $(XENDOMAINS_INITD) $(prefix)/etc/init.d 1.16 1.17 install-configs: 1.18 install -d $(prefix)$(XEN_CONFIG_DIR)
2.1 --- a/tools/examples/init.d/xendomains Thu Oct 21 13:47:32 2004 +0000 2.2 +++ b/tools/examples/init.d/xendomains Thu Oct 21 14:13:48 2004 +0000 2.3 @@ -17,7 +17,7 @@ 2.4 2.5 RETVAL=0 2.6 2.7 -INITD=/etc/init.d/ 2.8 +INITD=/etc/init.d 2.9 2.10 AUTODIR=/etc/xen/auto 2.11 LOCKFILE=/var/lock/subsys/xendomains 2.12 @@ -36,7 +36,7 @@ if [ -e /lib/lsb ]; then 2.13 log_failure_msg 2.14 fi 2.15 } 2.16 -else 2.17 +elif [ -r $INITD/functions ]; then 2.18 # assume a Redhat-like distro 2.19 . $INITD/functions # source Redhat functions 2.20 2.21 @@ -50,6 +50,14 @@ else 2.22 2.23 echo 2.24 } 2.25 +else 2.26 + # none of the above 2.27 + LOCKFILE=/var/lock/xendomains 2.28 + 2.29 + on_fn_exit() 2.30 + { 2.31 + echo 2.32 + } 2.33 fi 2.34 2.35 2.36 @@ -66,7 +74,7 @@ start() { 2.37 2.38 # Create all domains with config files in AUTODIR. 2.39 for dom in $AUTODIR/*; do 2.40 - xm create --quiet --defaults $dom 2.41 + xm create --quiet --defconfig $dom 2.42 if [ $? -ne 0 ]; then 2.43 RETVAL=$? 2.44 fi 2.45 @@ -86,7 +94,7 @@ stop() 2.46 2.47 echo -n $"Shutting down all Xen domains:" 2.48 2.49 - xm shutdown --all --wait --norestart 2.50 + xm shutdown --all --wait --halt 2.51 2.52 RETVAL=$? 2.53
3.1 --- a/tools/python/xen/xm/shutdown.py Thu Oct 21 13:47:32 2004 +0000 3.2 +++ b/tools/python/xen/xm/shutdown.py Thu Oct 21 14:13:48 2004 +0000 3.3 @@ -46,7 +46,7 @@ def shutdown(opts, doms, mode, wait): 3.4 server.xend_domain_shutdown(d, mode) 3.5 if wait: 3.6 while doms: 3.7 - alive = domains() 3.8 + alive = server.xend_domains() 3.9 dead = [] 3.10 for d in doms: 3.11 if d in alive: continue 3.12 @@ -73,7 +73,8 @@ def shutdown_mode(opts): 3.13 return mode 3.14 3.15 def main_all(opts, args): 3.16 - shutdown(opts, None, opts.vals.wait) 3.17 + mode = shutdown_mode(opts) 3.18 + shutdown(opts, None, mode, opts.vals.wait) 3.19 3.20 def main_dom(opts, args): 3.21 if len(args) < 1: opts.err('Missing domain')