[systemd-devel] stop service in 3 steps

Georg Müller georgmueller at gmx.net
Tue Nov 26 11:06:34 UTC 2024


Hi all,

I am currently trying to set up a 3-step kill mode for an application and this seems not possible with systemd.

Here is the scenario I a trying to achieve:

* on 'systemctl stop ...', the service should receive the TERM signal (KillSignal=SIGTERM)
* after a certain amount of time, the service should receive the ABRT signal (FinalKillSignal=SIGABRT)
  * the service has a signal handler for SIGABRT
* if, for some reason, the SIGABRT signal handler hangs, after some timeout, the service should be (really finnally) killed with an un-catchable
signal (SIGKILL)

The last step is not possible to set up. The service enters the "failed" state. It would be nice to have an option to send another signal when
entering failed.

Any ideas on how to implement this or if it is worth another directive in systemd?

Best regards,
Georg



More information about the systemd-devel mailing list