[GH-ISSUE #431] Increase delay before issuing SIGKILL on shutdown? #313

Closed
opened 2026-05-05 05:35:05 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @pyther on GitHub (Apr 13, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/431

Would it be possible to increase the time that is waited before sending a SIGTERM on shutdown?

I have an application that may need to write data to disk when it receives a SIGTERM. The current value of 2 seconds seems low and may not give an application enough to gracefully shutdown. There does not appear to be a standard on how long to wait after sending a SIGTERM, but systemd waits 10 seconds after SIGTERM before issuing additional signals.

#define TIMEOUT_USEC (10 * USEC_PER_SEC)
until = now(CLOCK_MONOTONIC) + TIMEOUT_USEC;
https://github.com/systemd/systemd/blob/master/src/core/killall.c#L36

Would it be possible to send a SIGTERM and then loop every 0.5 second or so checking to see if the children have died, sending a SIGTERM after 10 seconds?

https://stackoverflow.com/questions/27570302/how-much-time-before-sigkill

Originally created by @pyther on GitHub (Apr 13, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/431 Would it be possible to increase the time that is waited before sending a SIGTERM on shutdown? I have an application that may need to write data to disk when it receives a SIGTERM. The current value of 2 seconds seems low and may not give an application enough to gracefully shutdown. There does not appear to be a standard on how long to wait after sending a SIGTERM, but systemd waits 10 seconds after SIGTERM before issuing additional signals. `#define TIMEOUT_USEC (10 * USEC_PER_SEC)` `until = now(CLOCK_MONOTONIC) + TIMEOUT_USEC;` https://github.com/systemd/systemd/blob/master/src/core/killall.c#L36 Would it be possible to send a SIGTERM and then loop every 0.5 second or so checking to see if the children have died, sending a SIGTERM after 10 seconds? https://stackoverflow.com/questions/27570302/how-much-time-before-sigkill
gitea-mirror 2026-05-05 05:35:05 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@netblue30 commented on GitHub (Apr 13, 2016):

I'll bring something in soon, thanks!

<!-- gh-comment-id:209436091 --> @netblue30 commented on GitHub (Apr 13, 2016): I'll bring something in soon, thanks!
Author
Owner

@netblue30 commented on GitHub (Apr 14, 2016):

Fixed in main branch.

<!-- gh-comment-id:209939638 --> @netblue30 commented on GitHub (Apr 14, 2016): Fixed in main branch.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#313
No description provided.