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
F173663396: D47005.id146719.diff
Sun, Sep 27, 1:50 PM
Unknown Object (File)
Fri, Sep 25, 11:15 PM
Unknown Object (File)
Thu, Sep 24, 9:39 AM
Unknown Object (File)
Wed, Sep 23, 6:02 AM
Unknown Object (File)
Tue, Sep 22, 11:23 PM
Unknown Object (File)
Tue, Sep 22, 11:23 PM
Unknown Object (File)
Tue, Sep 22, 11:21 PM
Unknown Object (File)
Fri, Sep 11, 6:03 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 59826
Build 56711: arc lint + arc unit