All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone
@ 2010-12-14  8:38 Kouya Shimura
  2010-12-14 17:16 ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Kouya Shimura @ 2010-12-14  8:38 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 199 bytes --]

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@jp.fujitsu.com>


[-- Attachment #2: locking.sh.patch --]
[-- Type: text/x-patch, Size: 483 bytes --]

diff -r 89116f28083f tools/hotplug/Linux/locking.sh
--- a/tools/hotplug/Linux/locking.sh	Wed Dec 08 10:46:31 2010 +0000
+++ b/tools/hotplug/Linux/locking.sh	Mon Dec 13 10:36:25 2010 +0900
@@ -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 ]

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-12-15 16:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-14  8:38 [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone Kouya Shimura
2010-12-14 17:16 ` Ian Jackson
2010-12-15  4:26   ` Kouya Shimura
2010-12-15 16:49     ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.