Page MenuHomeFreeBSD

daemon: tests: add a test for missed SIGTERM
ClosedPublic

Authored by kevans on Oct 8 2024, 5:23 AM.
Tags
None
Referenced Files
F167012339: D47005.id144453.diff
Tue, Aug 18, 2:16 PM
Unknown Object (File)
Thu, Aug 13, 8:54 PM
Unknown Object (File)
Thu, Aug 13, 7:45 PM
Unknown Object (File)
Thu, Aug 13, 4:14 PM
Unknown Object (File)
Wed, Aug 12, 1:05 PM
Unknown Object (File)
Wed, Aug 12, 12:52 AM
Unknown Object (File)
Tue, Aug 11, 11:56 PM
Unknown Object (File)
Tue, Aug 11, 11:44 PM
Subscribers

Details

Summary

This is somewhaht hard to test reliably, but we'll give it a shot. Startup
a sleep(1) daemon with a hefty restart delay. In refactoring of daemon(8),
we inadvertently started dropping SIGTERMs that came in while we were
waiting to restart the child, so we employ the strategy:

  • Pop the child sleep(1) first
  • Wait for sleep(1) to exit (pid file truncated)
  • Pop the daemon(8) with a SIGTERM
  • Wait for daemon(8) to exit

The pidfile is specifically truncated outside of the event loop so that we
don't have a kqueue to catch it in the current model.

PR: 277959

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable