mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 14:20:40 +01:00
Leave lock file after timeout
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@149 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
621e8df85b
commit
b698fe4d6f
@ -116,7 +116,7 @@ get_statedir()
|
||||
mutex_on()
|
||||
{
|
||||
local try=0
|
||||
local max=15
|
||||
local max=30
|
||||
local int=2
|
||||
|
||||
local lockf=$STATEDIR/lock
|
||||
@ -124,7 +124,7 @@ mutex_on()
|
||||
[ -d $STATEDIR ] || mkdir -p $STATEDIR
|
||||
|
||||
if qt which lockfile; then
|
||||
lockfile -030 -r1 ${lockf} || rm -f ${lockf}
|
||||
lockfile -060 -r1 ${lockf}
|
||||
else
|
||||
while [ -f ${lockf} -a ${try} -lt ${max} ] ; do
|
||||
sleep ${int}
|
||||
@ -136,7 +136,6 @@ mutex_on()
|
||||
echo $$ > ${lockf}
|
||||
else
|
||||
echo "Giving up on lock file ${lockf}" >&2
|
||||
rm -f ${lockf}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user