On 11/05/2015 12:25 PM, matt darfeuille wrote: > My apologies for posting to quickly!!!:) > > Given that LOCKFILE needs a path name; the only line that need to be > change is the one that creats the missing directories in the function > mutex_on: > > [ -d $(dirname $lockf) ] || mkdir -p $(dirname $lockf) >
No problem :-) I've applied the attached patch. -Tom -- Tom Eastep \ When I die, I want to go like my Grandfather who Shoreline, \ died peacefully in his sleep. Not screaming like Washington, USA \ all of the passengers in his car http://shorewall.net \________________________________________________
diff --git a/Shorewall-core/lib.common b/Shorewall-core/lib.common
index 917338a..da468b9 100644
--- a/Shorewall-core/lib.common
+++ b/Shorewall-core/lib.common
@@ -709,12 +709,15 @@ mutex_on()
local lockf
lockf=${LOCKFILE:=${VARDIR}/lock}
local lockpid
+ local lockd
MUTEX_TIMEOUT=${MUTEX_TIMEOUT:-60}
if [ $MUTEX_TIMEOUT -gt 0 ]; then
- [ -d ${VARDIR} ] || mkdir -p ${VARDIR}
+ lockd=$(dirname $LOCKFILE)
+
+ [ -d "$lockd" ] || mkdir -p "$lockd"
if [ -f $lockf ]; then
lockpid=`cat ${lockf} 2> /dev/null`
@@ -734,6 +737,11 @@ mutex_on()
chmod u+w ${lockf}
echo $$ > ${lockf}
chmod u-w ${lockf}
+ elif qt mywhich lock; then
+ lock -${MUTEX_TIMEOUT} -r1 ${lockf}
+ chmod u+w ${lockf}
+ echo $$ > ${lockf}
+ chmod u-w ${lockf}
else
while [ -f ${lockf} -a ${try} -lt ${MUTEX_TIMEOUT} ] ; do
sleep 1
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ Shorewall-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shorewall-users
