File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ path_binaries() {
4545[ -z " $IP " ] && IP=ip_wrapper
4646[ -z " $TC_BINARY " ] && TC_BINARY=${BINDIR} /tc
4747[ -z " $IP_BINARY " ] && IP_BINARY=${BINDIR} /ip
48- [ -z " $LOCKFILE " ] && LOCKFILE =/tmp/var/lock/qos-sqm.lock
48+ [ -z " $RUNLOCK " ] && RUNLOCK =/tmp/var/lock/qos-sqm.lock
4949[ -z " $STATE_FILE " ] && STATE_FILE=/tmp/qos.state
5050[ " $SQM_DEBUG " = " 1" ] && QOS_LOG=/tmp/qosdebug.log
5151}
112112
113113run_lock () {
114114# take lock to protect against concurrent runs
115- local MAX_TRIES=10
115+ local MAX_TRIES=15
116116local TRIES=0
117117
118118 while [ ${TRIES} -lt ${MAX_TRIES} ]
119119 do
120- lock -n ${LOCKFILE } 2> /dev/null
120+ mkdir -m 0755 ${RUNLOCK } 2> /dev/null
121121 if [ $? -eq 0 ]; then
122- sqm_trace " Acquired run lock at pid: ` cat ${LOCKFILE} ` "
123- trap ' lock -u ${LOCKFILE }' EXIT
122+ sqm_trace " Acquired run lock"
123+ trap ' rm -rf ${RUNLOCK }' EXIT
124124 return 0
125125 fi
126- sqm_debug " Unable to get run lock - already held by pid: ` cat ${LOCKFILE} ` "
126+ sqm_debug " Unable to get run lock"
127127 sleep 1
128128 let TRIES++
129129 done
You can’t perform that action at this time.
0 commit comments