]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
daemon(8): Don't block SIGTERM during restart delay
authorcem <cem@FreeBSD.org>
Tue, 4 Jun 2019 16:07:01 +0000 (16:07 +0000)
committercem <cem@FreeBSD.org>
Tue, 4 Jun 2019 16:07:01 +0000 (16:07 +0000)
commit175ae3661abf2f4b0521067aaa5f2bbc1f9c8845
tree8175b1111c2c0ed016dabd206b933686c955cb3a
parent5ae3d73fb84aafd726f84dd6f0c9091f0e62a2d8
daemon(8): Don't block SIGTERM during restart delay

I believe this was introduced in the original '-r' commit, r231911 (2012).
At the time, the scope was limited to a 1 second sleep.  r332518 (2018)
added '-R', which increased the potential duration of the affected interval
(from 1 to N seconds) by permitting arbitrary restart intervals.

Instead, handle SIGTERM normally during restart-sleep, when the monitored
process is not running, and shut down promptly.

(I noticed this behavior when debugging a child process that exited quickly
under the 'daemon -r -R 30' environment.  'kill <daemonpid>' had no
immediate effect and the monitor process slept until the next restart
attempt.  This was annoying.)

Reviewed by: allanjude, imp, markj
Differential Revision: https://reviews.freebsd.org/D20509
usr.sbin/daemon/daemon.c