Strengthen plain stop wrappers

The prompts used to arrive at this change since the previous commit

User reported that the stop_mailcat script does not stop mailcat.

Any special observations that may be relevant for version management for this version. Be brief.

Plain-mode stop_mailcat.sh and stop_web.sh now wait longer after SIGTERM and fall back to SIGKILL. verplaats_log.json and plan.md were left unstaged.
This commit is contained in:
2026-07-05 11:35:44 +02:00
parent 99cd891b1e
commit d0e78e728a
2 changed files with 40 additions and 10 deletions
+32 -6
View File
@@ -184,10 +184,23 @@ fi
if kill -0 "\$pid" 2>/dev/null; then
kill "\$pid"
sleep 2
timeout=20
while [ "\$timeout" -gt 0 ] && kill -0 "\$pid" 2>/dev/null; do
sleep 1
timeout=\$((timeout - 1))
done
if kill -0 "\$pid" 2>/dev/null; then
echo "mailcat still running after SIGTERM: \$pid"
exit 1
echo "mailcat still running after SIGTERM, sending SIGKILL: \$pid"
kill -KILL "\$pid" 2>/dev/null || true
timeout=5
while [ "\$timeout" -gt 0 ] && kill -0 "\$pid" 2>/dev/null; do
sleep 1
timeout=\$((timeout - 1))
done
if kill -0 "\$pid" 2>/dev/null; then
echo "mailcat still running after SIGKILL: \$pid"
exit 1
fi
fi
fi
"\$RM" -f "\$PID_FILE"
@@ -286,10 +299,23 @@ fi
if kill -0 "\$pid" 2>/dev/null; then
kill "\$pid"
sleep 2
timeout=20
while [ "\$timeout" -gt 0 ] && kill -0 "\$pid" 2>/dev/null; do
sleep 1
timeout=\$((timeout - 1))
done
if kill -0 "\$pid" 2>/dev/null; then
echo "mailcat web still running after SIGTERM: \$pid"
exit 1
echo "mailcat web still running after SIGTERM, sending SIGKILL: \$pid"
kill -KILL "\$pid" 2>/dev/null || true
timeout=5
while [ "\$timeout" -gt 0 ] && kill -0 "\$pid" 2>/dev/null; do
sleep 1
timeout=\$((timeout - 1))
done
if kill -0 "\$pid" 2>/dev/null; then
echo "mailcat web still running after SIGKILL: \$pid"
exit 1
fi
fi
fi
"\$RM" -f "\$WEB_PID_FILE"