From 2cb55077e2f65f17dbc8933eec47760bcc2a6ba1 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 10 Dec 1999 08:25:07 +0000 Subject: Added poweroff (and adjusted init to use it). Inlined function calls to code only called once in tee. Made BB_KLOGD and option. -Erik --- sysklogd/syslogd.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'sysklogd') diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 1f3e31225..24c721f8e 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -62,6 +62,9 @@ static const char syslogd_usage[] = "Options:\n" "\t-m\tChange the mark timestamp interval. default=20min. 0=off\n" "\t-n\tDo not fork into the background (for when run by init)\n" +#ifdef BB_KLOGD + "\t-K\tDo not start up the klogd process (by default syslogd spawns klogd).\n" +#endif "\t-O\tSpecify an alternate log file. default=/var/log/messages\n"; @@ -251,6 +254,8 @@ static void doSyslogd(void) close(fd); } +#ifdef BB_KLOGD + static void klogd_signal(int sig) { ksyslog(7, NULL, 0); @@ -259,7 +264,6 @@ static void klogd_signal(int sig) exit( TRUE); } - static void doKlogd(void) { int priority=LOG_INFO; @@ -325,11 +329,15 @@ static void doKlogd(void) } +#endif extern int syslogd_main(int argc, char **argv) { int pid, klogd_pid; int doFork = TRUE; +#ifdef BB_KLOGD + int startKlogd = TRUE; +#endif char *p; char **argv1=argv; @@ -345,6 +353,11 @@ extern int syslogd_main(int argc, char **argv) case 'n': doFork = FALSE; break; +#ifdef BB_KLOGD + case 'K': + startKlogd = FALSE; + break; +#endif case 'O': if (--argc == 0) { usage(syslogd_usage); @@ -375,12 +388,16 @@ extern int syslogd_main(int argc, char **argv) doSyslogd(); } +#ifdef BB_KLOGD /* Start up the klogd process */ - klogd_pid = fork(); - if (klogd_pid == 0 ) { - strncpy(argv[0], "klogd", strlen(argv[0])); - doKlogd(); + if (startKlogd == TRUE) { + klogd_pid = fork(); + if (klogd_pid == 0 ) { + strncpy(argv[0], "klogd", strlen(argv[0])); + doKlogd(); + } } +#endif exit( TRUE); } -- cgit v1.2.3