HomeFreeBSD

daemon: tests: add a test for missed SIGTERM

Description

daemon: tests: add a test for missed SIGTERM

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
Reviewed by: des, markj
Differential Revision: https://reviews.freebsd.org/D47005

Details

Provenance
kevansAuthored on Nov 19 2024, 7:51 PM
Reviewer
des
Differential Revision
D47005: daemon: tests: add a test for missed SIGTERM
Parents
rGbc1dfc316a2b: daemon: stop rebuilding the kqueue every restart of the child
Branches
Unknown
Tags
Unknown