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

[Xen-changelog] [xen master] hotplug: Fix xendomains lock path for RHEL-based systems



commit 1209ba4218ae03067c4d42392229263750efe814
Author:     George Dunlap <george.dunlap@xxxxxxxxxx>
AuthorDate: Wed May 11 12:14:44 2016 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Wed May 11 15:39:43 2016 +0100

    hotplug: Fix xendomains lock path for RHEL-based systems
    
    Commit c996572 changed the LOCKFILE path from a check between two
    hardcoded paths (/var/lock/subsys/ or /var/lock) to using the
    XEN_LOCK_DIR variable designated at configure time.  Since
    XEN_LOCK_DIR doesn't (and shouldn't) have the 'subsys' postfix, this
    effectively moves all the lock files by default to /var/lock instead.
    
    Unfortunately, this breaks xendomains on RedHat-based SYSV init
    systems.  RedHat-based SYSV init systems try to only call "${SERVICE}
    shutdown" on systems which actually have an actively running
    component; and they use the existence of /var/lock/subsys/${SERVICE}
    to determine which systems are running.
    
    Changing XEN_LOCK_DIR to /var/lock/subsys is not suitable, as only
    system services like xendomains should create lockfiles there; other
    locks (such as the console locks) should be created in /var/lock
    instead.
    
    Instead, re-instate the check for the subsys/ subdirectory of the lock
    directory in the xendomains script.
    
    Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Olaf Hering <olaf@xxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/hotplug/Linux/xendomains.in | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/hotplug/Linux/xendomains.in 
b/tools/hotplug/Linux/xendomains.in
index 9f88649..727cd42 100644
--- a/tools/hotplug/Linux/xendomains.in
+++ b/tools/hotplug/Linux/xendomains.in
@@ -49,7 +49,13 @@ if [ ! -e /dev/xen/privcmd ] && [ ! -e /proc/xen/privcmd ]; 
then
        exit 0
 fi
 
-LOCKFILE=${XEN_LOCK_DIR}/xendomains
+# RHEL-based systems only shutdown a service if they find a lockfile
+# in /var/lock/subsys
+if [[ -d ${XEN_LOCK_DIR}/subsys ]] ; then
+    LOCKFILE=${XEN_LOCK_DIR}/subsys/xendomains
+else
+    LOCKFILE=${XEN_LOCK_DIR}/xendomains
+fi
 
 XENDOM_CONFIG=@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xendomains
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

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