<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>At least signals seem to be sent only only once.</p>
<p>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.<br>
</p>
<div class="moz-cite-prefix">On 15/01/2024 13.08, Lennart Poettering
wrote:<br>
</div>
<blockquote type="cite" cite="mid:ZaUELr3tlqVu2Xzw@gardel-login"><span
style="white-space: pre-wrap">
</span>
<pre wrap="" class="moz-quote-pre">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
</pre>
</blockquote>
</body>
</html>