mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 16:54:10 +01:00
Add MUTEX_TIMEOUT variable
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@150 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
b698fe4d6f
commit
b898747dc3
@ -3373,6 +3373,7 @@ do_initialize() {
|
||||
MULTIPORT=
|
||||
DETECT_DNAT_IPADDRS=
|
||||
MERGE_HOSTS=
|
||||
MUTEX_TIMEOUT=
|
||||
stopping=
|
||||
have_mutex=
|
||||
masq_seq=1
|
||||
|
@ -92,6 +92,8 @@ determine_zones()
|
||||
###############################################################################
|
||||
get_statedir()
|
||||
{
|
||||
MUTEX_TIMEOUT=
|
||||
|
||||
local config=`find_file shorewall.conf`
|
||||
|
||||
if [ -f $config ]; then
|
||||
@ -116,15 +118,19 @@ get_statedir()
|
||||
mutex_on()
|
||||
{
|
||||
local try=0
|
||||
local max=30
|
||||
local int=2
|
||||
local max=
|
||||
local int=1
|
||||
|
||||
local lockf=$STATEDIR/lock
|
||||
|
||||
MUTEX_TIMEOUT=${MUTEX_TIMEOUT:-60}
|
||||
|
||||
max=${MUTEX_TIMEOUT}
|
||||
|
||||
[ -d $STATEDIR ] || mkdir -p $STATEDIR
|
||||
|
||||
if qt which lockfile; then
|
||||
lockfile -060 -r1 ${lockf}
|
||||
lockfile -${MUTEX_TIMEOUT} -r1 ${lockf}
|
||||
else
|
||||
while [ -f ${lockf} -a ${try} -lt ${max} ] ; do
|
||||
sleep ${int}
|
||||
|
@ -291,4 +291,16 @@ DETECT_DNAT_IPADDRS=No
|
||||
|
||||
MERGE_HOSTS=Yes
|
||||
|
||||
#
|
||||
# Mutex Timeout
|
||||
#
|
||||
# The value of this variable determines the number of seconds that programs
|
||||
# will wait for exclusive access to the Shorewall lock file. After the number
|
||||
# of seconds corresponding to the value of this variable, programs will assume
|
||||
# that the last program to hold the lock died without releasing the lock.
|
||||
#
|
||||
# If not set or set to the empty value, a value of 60 (60 seconds) is assumed.
|
||||
|
||||
MUTEX_TIMEOUT=60
|
||||
|
||||
#LAST LINE -- DO NOT REMOVE
|
||||
|
Loading…
Reference in New Issue
Block a user