test: verify finit restarts crashing services & registers new PID

We extend the service.sh to emulate a well behaving service that creates
and removes its own PID file.

The new test emulates a crash by sending SIGKILL to service.sh.  We then
verify that Finit restarts it, and eventually registers the new PID when
the services recreates the PID file.

Issue #226

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-02-12 13:30:05 +01:00
parent f567b866a0
commit e9c8d3d740
4 changed files with 45 additions and 0 deletions
+4
View File
@@ -2,6 +2,10 @@
set -eu
echo $$ > /run/service.pid
while true; do
sleep 5
done
rm /run/service.pid