diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-02-14 20:51:46 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-02-14 20:51:46 +0000 |
commit | 2938e499417275f611fd34f9e22a728a50c3ae93 (patch) | |
tree | b774ded50a81e7af4e1abfeb91abcbd4e0adefb6 | |
parent | 082cb702aed87918673e80af406ea22d95b4464a (diff) | |
download | busybox-w32-2938e499417275f611fd34f9e22a728a50c3ae93.tar.gz busybox-w32-2938e499417275f611fd34f9e22a728a50c3ae93.tar.bz2 busybox-w32-2938e499417275f611fd34f9e22a728a50c3ae93.zip |
syslogd: MARK code is buggy. Disabling it altogether on anti-bloat grounds
git-svn-id: svn://busybox.net/trunk/busybox@17891 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | include/usage.h | 2 | ||||
-rw-r--r-- | sysklogd/syslogd.c | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/usage.h b/include/usage.h index fb1617a7c..f9d3de8c6 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -3054,7 +3054,6 @@ | |||
3054 | "System logging utility.\n" \ | 3054 | "System logging utility.\n" \ |
3055 | "Note that this version of syslogd ignores /etc/syslog.conf." \ | 3055 | "Note that this version of syslogd ignores /etc/syslog.conf." \ |
3056 | "\n\nOptions:" \ | 3056 | "\n\nOptions:" \ |
3057 | "\n -m MIN Minutes between MARK lines (default=20, 0=off)" \ | ||
3058 | "\n -n Run as foreground process" \ | 3057 | "\n -n Run as foreground process" \ |
3059 | "\n -O FILE Use an alternate log file (default=/var/log/messages)" \ | 3058 | "\n -O FILE Use an alternate log file (default=/var/log/messages)" \ |
3060 | "\n -l n Sets the local log level of messages to n" \ | 3059 | "\n -l n Sets the local log level of messages to n" \ |
@@ -3068,6 +3067,7 @@ | |||
3068 | USE_FEATURE_IPC_SYSLOG( \ | 3067 | USE_FEATURE_IPC_SYSLOG( \ |
3069 | "\n -C[size(KiB)] Log to a shared mem buffer (read the buffer using logread)") | 3068 | "\n -C[size(KiB)] Log to a shared mem buffer (read the buffer using logread)") |
3070 | /* NB: -Csize shouldn't have space (because size is optional) */ | 3069 | /* NB: -Csize shouldn't have space (because size is optional) */ |
3070 | /* "\n -m MIN Minutes between MARK lines (default=20, 0=off)" */ | ||
3071 | #define syslogd_example_usage \ | 3071 | #define syslogd_example_usage \ |
3072 | "$ syslogd -R masterlog:514\n" \ | 3072 | "$ syslogd -R masterlog:514\n" \ |
3073 | "$ syslogd -R 192.168.1.1:601\n" | 3073 | "$ syslogd -R 192.168.1.1:601\n" |
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 53290f1cc..53cb4ba5e 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -28,8 +28,13 @@ | |||
28 | static const char *logFilePath = "/var/log/messages"; | 28 | static const char *logFilePath = "/var/log/messages"; |
29 | static int logFD = -1; | 29 | static int logFD = -1; |
30 | 30 | ||
31 | /* This is not very useful, is bloat, and broken: | ||
32 | * can deadlock if alarmed to make MARK while writing to IPC buffer | ||
33 | * (semaphores are down but do_mark routine tries to down them again) */ | ||
34 | #ifdef SYSLOGD_MARK | ||
31 | /* interval between marks in seconds */ | 35 | /* interval between marks in seconds */ |
32 | static int markInterval = 20 * 60; | 36 | static int markInterval = 20 * 60; |
37 | #endif | ||
33 | 38 | ||
34 | /* level of messages to be locally logged */ | 39 | /* level of messages to be locally logged */ |
35 | static int logLevel = 8; | 40 | static int logLevel = 8; |
@@ -448,6 +453,7 @@ static void quit_signal(int sig) | |||
448 | exit(1); | 453 | exit(1); |
449 | } | 454 | } |
450 | 455 | ||
456 | #ifdef SYSLOGD_MARK | ||
451 | static void do_mark(int sig) | 457 | static void do_mark(int sig) |
452 | { | 458 | { |
453 | if (markInterval) { | 459 | if (markInterval) { |
@@ -455,6 +461,7 @@ static void do_mark(int sig) | |||
455 | alarm(markInterval); | 461 | alarm(markInterval); |
456 | } | 462 | } |
457 | } | 463 | } |
464 | #endif | ||
458 | 465 | ||
459 | static void do_syslogd(void) ATTRIBUTE_NORETURN; | 466 | static void do_syslogd(void) ATTRIBUTE_NORETURN; |
460 | static void do_syslogd(void) | 467 | static void do_syslogd(void) |
@@ -473,8 +480,10 @@ static void do_syslogd(void) | |||
473 | #ifdef SIGCLD | 480 | #ifdef SIGCLD |
474 | signal(SIGCLD, SIG_IGN); | 481 | signal(SIGCLD, SIG_IGN); |
475 | #endif | 482 | #endif |
483 | #ifdef SYSLOGD_MARK | ||
476 | signal(SIGALRM, do_mark); | 484 | signal(SIGALRM, do_mark); |
477 | alarm(markInterval); | 485 | alarm(markInterval); |
486 | #endif | ||
478 | 487 | ||
479 | memset(&sunx, 0, sizeof(sunx)); | 488 | memset(&sunx, 0, sizeof(sunx)); |
480 | sunx.sun_family = AF_UNIX; | 489 | sunx.sun_family = AF_UNIX; |
@@ -558,8 +567,10 @@ int syslogd_main(int argc, char **argv) | |||
558 | /* do normal option parsing */ | 567 | /* do normal option parsing */ |
559 | opt_complementary = "=0"; /* no non-option params */ | 568 | opt_complementary = "=0"; /* no non-option params */ |
560 | getopt32(argc, argv, OPTION_STR, OPTION_PARAM); | 569 | getopt32(argc, argv, OPTION_STR, OPTION_PARAM); |
570 | #ifdef SYSLOGD_MARK | ||
561 | if (option_mask32 & OPT_mark) // -m | 571 | if (option_mask32 & OPT_mark) // -m |
562 | markInterval = xatou_range(opt_m, 0, INT_MAX/60) * 60; | 572 | markInterval = xatou_range(opt_m, 0, INT_MAX/60) * 60; |
573 | #endif | ||
563 | //if (option_mask32 & OPT_nofork) // -n | 574 | //if (option_mask32 & OPT_nofork) // -n |
564 | //if (option_mask32 & OPT_outfile) // -O | 575 | //if (option_mask32 & OPT_outfile) // -O |
565 | if (option_mask32 & OPT_loglevel) // -l | 576 | if (option_mask32 & OPT_loglevel) // -l |