| 9ab59e90 | 19-Nov-2024 |
Kyle Evans <kevans@FreeBSD.org> |
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), w
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
show more ...
|
| bc1dfc31 | 19-Nov-2024 |
Kyle Evans <kevans@FreeBSD.org> |
daemon: stop rebuilding the kqueue every restart of the child
We populate the kqueue with all of four kevents: three signal handlers and one for read of the child pipe. Every time we start the chil
daemon: stop rebuilding the kqueue every restart of the child
We populate the kqueue with all of four kevents: three signal handlers and one for read of the child pipe. Every time we start the child, we rebuild this kqueue from scratch for the child and tear it down before we exit and check if we need to restart the child. As a consequence, we effectively drop any of the signals we're interested in between restarts.
Push the kqueue out into the daemon state to avoid losing any signal events in the process, and reimplement the restart timer in terms of kqueue timers. The pipe read event will be automatically deleted upon last close, which leaves us with only the signal events that really get retained between restarts of the child.
PR: 277959 Reviewed by: des, markj Differential Revision: https://reviews.freebsd.org/D47004
show more ...
|
| 5745a584 | 27-Dec-2023 |
Ihor Antonov <ihor@antonovs.family> |
daemon: replace memchr with memrchr
Looping over lines in the buffer is not needed. Same effect can be achieved by looking for the last new line. If found the buffer is guaranteed to have one or mor
daemon: replace memchr with memrchr
Looping over lines in the buffer is not needed. Same effect can be achieved by looking for the last new line. If found the buffer is guaranteed to have one or more complete lines. All complete lines are flushed at once with no looping.
Reviewed by: cperciva, kevans
show more ...
|
| 24fd3e96 | 27-Dec-2023 |
Ihor Antonov <ihor@antonovs.family> |
daemon: move buffer into daemon_state
There is no reason for a buffer in listen_child() to be a static function variable. The buffer and its position are parts of the daemon state and should live to
daemon: move buffer into daemon_state
There is no reason for a buffer in listen_child() to be a static function variable. The buffer and its position are parts of the daemon state and should live together with the rest of the state variables.
Reviewed by: cperciva, kevans
show more ...
|
| c1207678 | 18-Sep-2023 |
Mateusz Piotrowski <0mp@FreeBSD.org> |
daemon.8: Document -u sets HOME, USER, and SHELL
Fixes: 6b3ad1d73732 When -u option is used also set USER, HOME and SHELL MFC after: 3 days |