Bug 197379 - [PATCH] Add an option to run `syslogd' in the foreground
Summary: [PATCH] Add an option to run `syslogd' in the foreground
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2015-02-06 19:45 UTC by Ravi Pokala
Modified: 2015-03-03 20:24 UTC (History)
0 users

See Also:
rpokala: mfc-stable10?
rpokala: mfc-stable9?
rpokala: mfc-stable8?

Add a '-F' option to make `syslogd' run in the foreground (2.12 KB, patch)
2015-02-06 19:45 UTC, Ravi Pokala
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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?)