Bug 197379

Summary: [PATCH] Add an option to run `syslogd' in the foreground
Product: Base System Reporter: Ravi Pokala <rpokala>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me Flags: rpokala: mfc-stable10?
rpokala: mfc-stable9?
rpokala: mfc-stable8?
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Add a '-F' option to make `syslogd' run in the foreground none

Description Ravi Pokala 2015-02-06 19:45:05 UTC
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.
Comment 1 Ravi Pokala 2015-03-03 20:24:40 UTC
Fixed in -HEAD by r279567. Please MFC to older releases after (1 week?)