]> xenbits.xensource.com Git - xen.git/commitdiff
bitkeeper revision 1.1159.122.1 (4177c41conAxvsSnGCUYzYBlBVfqCQ)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 21 Oct 2004 14:13:48 +0000 (14:13 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 21 Oct 2004 14:13:48 +0000 (14:13 +0000)
Fix init.d/xendomains.

tools/examples/Makefile
tools/examples/init.d/xendomains
tools/python/xen/xm/shutdown.py

index 811a6872413e119c7961f6137b9d07c0887bfc3c..1e77f89d5023c2ea3f41c1631b66e7262f30e43d 100644 (file)
@@ -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)
index 41524e6f5740f307e7cf5614ad2d234e15902cee..c52c3cc0e9758d07c56d549940d4f7d11c1400fd 100755 (executable)
@@ -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=$?
 
index 73324ddd40d2f6065ea1d2cfd5ec817c0cd87003..39ec78357d558d5f314f4b65d0f41aa75aa0871a 100644 (file)
@@ -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')