service: keep a stop of a forking service waiting for its PID file

Stopping a forking service after its start script had exited, but
before the daemon had written its PID file, did not hold.  When the
PID file showed up, the service was reported running again and the
daemon was left alone:

    initctl stop ext

service_forked() cleared any block on the service, the user's stop
included.

Keep a user stop, and let the state machine stop the late daemon of
a service no longer enabled.  The service is briefly RUNNING on its
way to STOPPING, so service/NAME/running blinks on and off.

Follow-up to #452

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-17 07:49:50 +01:00
1 parent a1706e8ebd
commit 35c313c2fa
5 files changed
+47 -9

No files matched your search

+3
View File
@@ -173,6 +173,9 @@ All relevant changes are documented in this file.
reported as running, with its conditions set, when another process wrote
that PID file, e.g., a container started by hand with podman. Found by
Mattias Walström
- Fix `initctl stop` of a forking service before it had written its PID
file. The PID file showing up later undid the stop and the service was
reported running. Now the late daemon is stopped instead
- Fix a command whose name starts like a service option, e.g. `logger` or
`pidof`. It was taken as the `log` or `pid` option and the next argument
ran as the command, which also broke the `logger` example in finit.conf(5)