From: Kouya Shimura <kouya@jp.fujitsu.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone
Date: Tue, 14 Dec 2010 17:38:24 +0900 [thread overview]
Message-ID: <7kk4jchhpw.fsf@jp.fujitsu.com> (raw)
[-- 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
next reply other threads:[~2010-12-14 8:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-14 8:38 Kouya Shimura [this message]
2010-12-14 17:16 ` [PATCH] tools/hotplug/Linux: forced to release lock if holder process is gone Ian Jackson
2010-12-15 4:26 ` Kouya Shimura
2010-12-15 16:49 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7kk4jchhpw.fsf@jp.fujitsu.com \
--to=kouya@jp.fujitsu.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.