freebsd-src/usr.sbin/daemon
Kyle Evans 9ab59e900c
Some checks are pending
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /opt/homebrew/opt/llvm@18/bin, macos-latest, bmake libarchive llvm@18, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /opt/homebrew/opt/llvm@18/bin, macos-latest, bmake libarchive llvm@18, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /usr/lib/llvm-18/bin, ubuntu-24.04, bmake libarchive-dev clang-18 lld-18, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /usr/lib/llvm-18/bin, ubuntu-24.04, bmake libarchive-dev clang-18 lld-18, arm64, aarch64) (push) Waiting to run
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
2024-11-19 13:51:27 -06:00
..
tests daemon: tests: add a test for missed SIGTERM 2024-11-19 13:51:27 -06:00
daemon.8 daemon: Add -C (--restart-count) option 2024-05-22 09:45:23 +02:00
daemon.c daemon: stop rebuilding the kqueue every restart of the child 2024-11-19 13:51:27 -06:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00