diff --git a/src/usr/sbin/one-contextd b/src/usr/sbin/one-contextd index dc2cd1b..15e251d 100755 --- a/src/usr/sbin/one-contextd +++ b/src/usr/sbin/one-contextd @@ -216,6 +216,8 @@ function run_context { } function acquire_lock { + local _retry=120 + # acquire for execution lock log debug "Acquiring lock ${LOCK_FILE}" while true; do @@ -225,6 +227,12 @@ function acquire_lock { break fi + _retry=$((_retry - 1)) + if [ ${_retry} -le 0 ]; then + log err "Error: Could not acquire lock ${LOCK_FILE}" 2 + exit 1 + fi + sleep 1 done }