WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tools/hotplug/Linux: forced to release lo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/hotplug/Linux: forced to release lock if holder process is gone
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Dec 2010 05:34:06 -0800
Delivery-date: Thu, 23 Dec 2010 05:39:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Kouya Shimura <kouya@xxxxxxxxxxxxxx>
# Date 1292346948 0
# Node ID 57907b28e51abc1cd62979a9915d560e427cbacf
# Parent  f46d49257da5b0d6c7042c9539d40372c0ddf1a3
tools/hotplug/Linux: forced to release lock if holder process is gone

When a script using locking.sh is stopped by ctrl-C, the lock file remains.
We have to wait 100 seconds for releasing the lock at the next time.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/hotplug/Linux/locking.sh |    6 ++++++
 1 files changed, 6 insertions(+)

diff -r f46d49257da5 -r 57907b28e51a tools/hotplug/Linux/locking.sh
--- a/tools/hotplug/Linux/locking.sh    Tue Dec 14 16:56:54 2010 +0000
+++ b/tools/hotplug/Linux/locking.sh    Tue Dec 14 17:15:48 2010 +0000
@@ -61,6 +61,12 @@ _claim_lock()
     then
       owner="$new_owner"
       retries=0
+    else
+      local pid=$(echo $owner | cut -d : -f 1)
+      if [ ! -f "/proc/$pid/status" ]
+      then
+        _release_lock $lockdir
+      fi
     fi
 
     if [ $retries -gt $LOCK_SPINNING_RETRIES ]

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/hotplug/Linux: forced to release lock if holder process is gone, Xen patchbot-unstable <=