diff options
author | Eric Andersen | 1999-12-10 08:25:07 +0000 |
---|---|---|
committer | Eric Andersen | 1999-12-10 08:25:07 +0000 |
commit | 2cb55077e2f65f17dbc8933eec47760bcc2a6ba1 (patch) | |
tree | a788718415ded192938d7c7a3661d0cab8cd8afe /sysklogd | |
parent | c5ff0165adac767d37103baa875c2f86bb43c0e1 (diff) | |
download | busybox-2cb55077e2f65f17dbc8933eec47760bcc2a6ba1.zip busybox-2cb55077e2f65f17dbc8933eec47760bcc2a6ba1.tar.gz |
Added poweroff (and adjusted init to use it). Inlined function
calls to code only called once in tee. Made BB_KLOGD and option.
-Erik
Diffstat (limited to 'sysklogd')
-rw-r--r-- | sysklogd/syslogd.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 1f3e312..24c721f 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); } |