mirror of
https://github.com/troglobit/finit.git
synced 2026-10-27 12:20:54 +00:00
test: slay must wait up to five seconds before giving up
Default max delay before restarting a crashing service is five seconds. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
fb86042cb3
commit
d5f542dcca
1 file changed
+10
-3
+10
-3
@@ -28,10 +28,16 @@ if [ -f oldpid ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$pid" -le 1 ]; then
|
timeout=50
|
||||||
sleep 3
|
while [ "$pid" -le 1 ]; do
|
||||||
|
sleep 0.1
|
||||||
pid=$(getpid "$nm")
|
pid=$(getpid "$nm")
|
||||||
if [ "$pid" -le 1 ]; then
|
if [ "$pid" -le 1 ]; then
|
||||||
|
timeout=$((timeout - 1))
|
||||||
|
if [ "$timeout" -gt 0 ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Got a bad PID: $pid, aborting ..."
|
echo "Got a bad PID: $pid, aborting ..."
|
||||||
ps
|
ps
|
||||||
sleep 1
|
sleep 1
|
||||||
@@ -39,7 +45,8 @@ if [ "$pid" -le 1 ]; then
|
|||||||
ps
|
ps
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
break
|
||||||
|
done
|
||||||
|
|
||||||
echo "$pid" > oldpid
|
echo "$pid" > oldpid
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user