From 163aa84cc4543142590aab6f36f94e8480d55b16 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 1 Dec 2019 21:17:02 +0100 Subject: [PATCH] klogd: Add '-F' as alias for '-n', for compat with syslogd Signed-off-by: Joachim Nilsson --- man/klogd.8 | 4 ++-- src/klogd.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/man/klogd.8 b/man/klogd.8 index 8cd079f..9ef9ee1 100644 --- a/man/klogd.8 +++ b/man/klogd.8 @@ -13,7 +13,7 @@ .Nd Kernel Log Daemon .Sh SYNOPSIS .Nm -.Op Fl 2ndnopsvx +.Op Fl 2dFnopsvx .Op Fl c Ar NUM .Op Fl f Ar FILE .Op Fl k Ar FILE @@ -31,7 +31,7 @@ Enable debugging mode. This will generate potentially LOTS of output to stderr. .It Fl f Ar FILE Log messages to the specified filename rather than to the syslog facility. -.It Fl n +.It Fl n | Fl F Run in foreground, required when run from a modern init/supervisor. See your system .Xr init 1 diff --git a/src/klogd.c b/src/klogd.c index 39dfd48..ead591d 100644 --- a/src/klogd.c +++ b/src/klogd.c @@ -606,7 +606,7 @@ int usage(int code) " -d Enable debug mode\n" " -f FILE Log messages to FILE rather than the syslog facility\n" " -k FILE Location of kernel symbols (System.map), default: auto\n" - " -n Run in foreground, required when run from a modern init/supervisor\n" + " -n | -F Run in foreground, required when run from a modern init/supervisor\n" " -o Run once, read kernel log messages and syslog them, then exit\n" " -p Paranoia mode, forces klogd to reload all kernel symbols on Ooops\n" " -s Force use of system call interface to kernel message buffers\n" @@ -629,7 +629,7 @@ int main(int argc, char *argv[]) pid_t ppid = getpid(); /* Parse the command-line. */ - while ((ch = getopt(argc, argv, "c:df:k:nopsvx2?")) != EOF) { + while ((ch = getopt(argc, argv, "c:dFf:k:nopsvx2?")) != EOF) { switch (ch) { case '2': /* Print lines with symbols twice. */ symbols_twice = 1; @@ -652,6 +652,7 @@ int main(int argc, char *argv[]) symfile = optarg; break; + case 'F': /* compat with syslogd */ case 'n': /* don't fork */ no_fork++; break;