debuggers.hg
changeset 22554:57907b28e51a
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@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
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>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author | Kouya Shimura <kouya@jp.fujitsu.com> |
---|---|
date | Tue Dec 14 17:15:48 2010 +0000 (2010-12-14) |
parents | f46d49257da5 |
children | 5e443a99b1ff |
files | tools/hotplug/Linux/locking.sh |
line diff
1.1 --- a/tools/hotplug/Linux/locking.sh Tue Dec 14 16:56:54 2010 +0000 1.2 +++ b/tools/hotplug/Linux/locking.sh Tue Dec 14 17:15:48 2010 +0000 1.3 @@ -61,6 +61,12 @@ sigerr() { 1.4 then 1.5 owner="$new_owner" 1.6 retries=0 1.7 + else 1.8 + local pid=$(echo $owner | cut -d : -f 1) 1.9 + if [ ! -f "/proc/$pid/status" ] 1.10 + then 1.11 + _release_lock $lockdir 1.12 + fi 1.13 fi 1.14 1.15 if [ $retries -gt $LOCK_SPINNING_RETRIES ]