[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 4 of 4] always create a lockfile on xendomains service start



# HG changeset patch
# User Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
# Date 1307569509 14400
# Node ID ab0a7d100668a25f0e6f025b474694962e2e8aef
# Parent  b944852b97898ed11ea10eb9301efadc19ec50ca
always create a lockfile on xendomains service start

Currently if there's no saved VMs or VMs under /etc/xen/auto, the lockfile will
not be created.

If no lockfile, when system reboot, system will not wait xendomains service to
stop. Thus any running VMs without a link to /etc/xen/auto will not be cleanly
shutdown.

Signed-off-by: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>

diff -r b944852b9789 -r ab0a7d100668 tools/hotplug/Linux/init.d/xendomains
--- a/tools/hotplug/Linux/init.d/xendomains     Wed Jun 08 17:45:09 2011 -0400
+++ b/tools/hotplug/Linux/init.d/xendomains     Wed Jun 08 17:45:09 2011 -0400
@@ -249,8 +249,6 @@ start()
     if [ "$XENDOMAINS_RESTORE" = "true" ] &&
        contains_something "$XENDOMAINS_SAVE"
     then
-       mkdir -p $(dirname "$LOCKFILE")
-       touch $LOCKFILE
        echo -n "Restoring Xen domains:"
        saved_domains=`ls $XENDOMAINS_SAVE`
         for dom in $XENDOMAINS_SAVE/*; do
@@ -276,7 +274,6 @@ start()
 
     if contains_something "$XENDOMAINS_AUTO"
     then
-       touch $LOCKFILE
        echo -n "Starting auto Xen domains:"
        # We expect config scripts for auto starting domains to be in
        # XENDOMAINS_AUTO - they could just be symlinks to files elsewhere
@@ -305,6 +302,8 @@ start()
            fi
        done
     fi
+       mkdir -p $(dirname "$LOCKFILE")
+       touch $LOCKFILE
 }
 
 all_zombies()

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.