At least signals seem to be sent only only once.
A process in a login shell can wait for TERM (and two HUPs if on
console), wait a bit after this, then safely fork cleanup tasks
and exit before KILL comes.
On 15/01/2024 13.08, Lennart Poettering
wrote:
When the goal is to shut down a service/session, then intend to give guarantees that the shut down time is bounded: we first send SIGTERM, and start a timeout. If by that timeout there are still processes left we SIGKILL to put an end to things. If we'd somehow distinguish new/old processes then we couldn't put the boundary on the shutdown process... So no, this does not exist. You can fork if you want, but it won't add time to the time-out. Lennart -- Lennart Poettering, Berlin