Created attachment 152635 [details]
Add a '-F' option to make `syslogd' run in the foreground
There is a narrow window while `syslogd' is restarting (such as when getting restarted by `newsyslog') wherein it might die, without cleaning up its PID file. (syslogd.c:waitdaemon() - if fork() fails, waitdaemon() calls errx(), and thus never returns. pidfile_remove() only gets called if waitdaemon() returns a negative value.)
For this and other reasons, we've modified `syslogd' to run in the foreground, so a nanny process can immediately detect it exiting and restart it if needed. The attached patch adds a '-F' command-line argument to make `syslogd' run in foreground mode.
Fixed in -HEAD by r279567. Please MFC to older releases after (1 week?)