mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
test: don't slay a service Finit has given up on
Once it gives up it forks the post:script and reports that PID as the service's, so a slay still waiting for the service to come back killed the script instead, and crashing.sh lost the /tmp/post it checks for. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -30,6 +30,13 @@ fi
|
||||
timeout=50
|
||||
while [ "$pid" -le 1 ]; do
|
||||
sleep 0.1
|
||||
# Once Finit gives up on a service it forks the post:script and
|
||||
# reports that PID as the service's, so a slay still waiting for
|
||||
# the service to come back would kill the script instead.
|
||||
st=$(initctl -p status "$nm" 2>/dev/null | awk '/Status/{print $3}')
|
||||
if [ "$st" = "crashed" ]; then
|
||||
exit 1
|
||||
fi
|
||||
pid=$(getpid "$nm")
|
||||
if [ "$pid" -le 1 ]; then
|
||||
timeout=$((timeout - 1))
|
||||
|
||||
Reference in New Issue
Block a user