From 27e36c171f0b422cddbdce3865cf65421e5c5482 Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 16 Jan 2006 16:45:25 +0000 Subject: [PATCH] Correct locking on 'reload' git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3299 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/firewall | 10 +--------- Shorewall/shorewall | 6 +++++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Shorewall/firewall b/Shorewall/firewall index f8e0232db..b923e4bfc 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -47,14 +47,6 @@ # the corresponding function in that file if the user did # not specify "nolock" on the runline. # -my_mutex_on() { - [ -n "$nolock" ] || { mutex_on; HAVE_MUTEX=Yes; } -} - -my_mutex_off() { - [ -n "$HAVE_MUTEX" ] && { mutex_off; HAVE_MUTEX=; } -} - # # Fatal error -- stops the firewall after issuing the error message # @@ -9209,7 +9201,7 @@ stop_firewall() set_state "Unknown" fi elif [ -x /sbin/shorewall ]; then - /sbin/shorewall stop + /sbin/shorewall nolock stop fi kill \$\$ diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 6a9ea5605..b7ec414e8 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -966,9 +966,13 @@ case "$1" in export NOROUTES + [ -n "$nolock" ] || mutex_on + if $SHOREWALL_SHELL $FIREWALL $debugging $nolock compile /var/lib/shorewall/.reload; then - $0 $(make_quiet) restore .reload + $0 $(make_quiet) restore nolock .reload fi + + [ -n "$nolock" ] || mutex_off ;; add|delete) [ $# -lt 3 ] && usage 1