aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-12-10 08:25:07 +0000
committerEric Andersen <andersen@codepoet.org>1999-12-10 08:25:07 +0000
commit2cb55077e2f65f17dbc8933eec47760bcc2a6ba1 (patch)
treea788718415ded192938d7c7a3661d0cab8cd8afe /sysklogd
parentc5ff0165adac767d37103baa875c2f86bb43c0e1 (diff)
downloadbusybox-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.c27
1 files changed, 22 insertions, 5 deletions
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);
}