summaryrefslogtreecommitdiff
path: root/sysklogd
Commit message (Collapse)AuthorAgeFilesLines
...
* whitespace fixes. no code changesDenys Vlasenko2013-01-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: add option to log to Linux kernel printk bufferPeter Korsgaard2013-01-062-1/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why invent our own shared memory circular buffer when the kernel has a perfectly fine one already? This can be used as a smaller/simpler alternative to the syslogd IPC support (as IPC shmem/klogd/logread aren't needed), while also allowing centralised logging of everything (kernel messages, userspace bootup and syslog) when used together with ttyprintk. Notice that kernel 3.5+ is needed to store syslog facility in printk buffer, otherwise only the priority is stored. bloat-o-meter compared to IPC+klogd+logread: function old new delta get_linux_version_code - 84 +84 lbb_prepare 25 90 +65 applet_nameofs 6 - -6 static.stdout@@GLIBC_2 8 - -8 applet_names 23 9 -14 bb_msg_standard_output 16 - -16 init_sem 18 - -18 xatoull_range 19 - -19 overlapping_strcpy 21 - -21 init_data 56 32 -24 applet_main 24 - -24 main 124 99 -25 full_write2_str 26 - -26 error_exit 26 - -26 bb_basename 30 - -30 sem_up 32 - -32 interrupted 35 - -35 fflush_stdout_and_exit 38 - -38 bb_banner 46 - -46 find_applet_by_name 59 - -59 bb_signals_recursive_norestart 90 - -90 run_applet_no_and_exit 104 - -104 timestamp_and_log 651 523 -128 syslogd_main 798 581 -217 xstrtoull_range_sfx 267 - -267 run_applet_and_exit 432 - -432 klogd_main 490 - -490 logread_main 508 - -508 .rodata 1870 937 -933 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 2/26 grow/shrink: 1/6 up/down: 149/-11829) Total: -11680 bytes Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* klogd: handle multi-char log levelsPeter Korsgaard2013-01-051-5/+2
| | | | | | | | | | | | | | Since Linux 3.5 (7ff9554bb5: printk: convert byte-buffer to variable-length record buffer), klog buffer can now contain log lines with multi-char loglevel indicators (<[0-9]+>) - So use strtoul to parse it. function old new delta klogd_main 490 525 +35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 35/0) Total: 35 bytes Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* CONFIG_PID_FILE_PATH: new configuration option for pidfile pathsAnthony G. Basile2012-12-192-1/+7
| | | | | | | | | | | | | | | We set a default path for the directory where pidfiles are create when FEATURE_PIDFILE is selected. The default has no effect on applets which must specify a pidfile path on the command line to run, and it can be overridden by applets which optionally allow the user to specify the pidfile path. We also add pidfile write/remove support for klogd, ntpd and watchdog. For syslogd, we add a missing remove_pidfile() for better cleanup on daemon exit. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* syslogd: work around rename() not renaming hardlinks to themselvesChristian Engelmayer2011-10-281-0/+8
| | | | | | | | | | | | | | | | | | | | | Function log_locally() within the syslogd can potentially lock up when restarting the daemon after a power loss in case the unplanned shutdown hit the rename operation during logfile rotation. While POSIX requires the rename operation to be atomic, many file systems such as JFFS2 implement the rename operation in 2 steps by linking the new name followed by unlinking the original name. In case of a power loss during the rename the system can end up with /var/log/messages and /var/log/messages.0 being 2 hard links to the same file. When the syslog daemon restarts in such a situation it will rediscover the need to rotate the log files, however, POSIX also requires that rename does nothing and reports success in case oldpath and newpath are existing hard links to the same file. Looping through reopen: by (O_CREAT | O_APPEND), the daemon eternally reopens the same file without succeeding to rotate. Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: fix missing newline problen in memory log buffer. Closes 4159Denys Vlasenko2011-09-161-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove "Options:" string from help textsDenys Vlasenko2011-06-054-4/+0
| | | | | | | function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd,klogd: better help textDenys Vlasenko2011-05-252-13/+20
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* small fixes atop syslog config patchDenys Vlasenko2011-04-162-8/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: small fix to config patchSergey Naumov2011-04-161-3/+9
| | | | | Signed-off-by: Sergey Naumov <sknaumov@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move remaining help text from include/usage.src.hPere Orga2011-04-114-0/+54
| | | | | Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: optional support for /etc/syslog.confSergey Naumov2011-04-102-65/+275
| | | | | | | | | | | | | | | function old new delta syslogd_main 1241 1870 +629 timestamp_and_log 301 540 +239 find_by_name - 37 +37 find_by_val - 22 +22 init_data 64 68 +4 log_locally 603 413 -190 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/1 up/down: 931/-190) Total: 741 bytes Signed-off-by: Sergey Naumov <sknaumov@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* klogd: fix the problem of delayed handling of ^C and SIGTERMDenys Vlasenko2011-03-071-1/+30
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Replace "depends on PLATFORM_LINUX" with "select PLATFORM_LINUX"Denys Vlasenko2011-02-261-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add ENABLE_FEATURE_SYSTEMD and use it in syslogdDavide Cavalca2011-01-251-0/+5
| | | | | Signed-off-by: Davide Cavalca <davide@geexbox.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: whitespace fixesDenys Vlasenko2010-10-281-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* klogd: do not log partial linesDenys Vlasenko2010-10-191-9/+10
| | | | | | | | function old new delta overlapping_strcpy 15 18 +3 klogd_main 438 436 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-166-6/+6
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: close/re-resolve/reopen remote sockets on some sendto() errorsDaniel Dickinson2010-08-031-6/+20
| | | | | | | | function old new delta syslogd_main 1201 1262 +61 Signed-off-by: Daniel Dickinson <cshore@csolve.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* klogd: make it work on non-linux systemsJeremie Koenig2010-08-012-19/+126
| | | | | | | | | | | | The klogctl() interface allows changing the console loglevel, but is Linux-specific. The more portable method of reading from _PATH_KLOG is added as an alternative. Adapted from the Debian kFreeBSD patch at: http://svn.debian.org/viewsvn/d-i/people/slackydeb/kfreebsd/busybox/1.14/debian/klogd.diff Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: trailing empty lines removedDenys Vlasenko2010-07-261-1/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mark Linux-specific configuration optionsJeremie Koenig2010-07-191-0/+1
| | | | | | | | PLATFORM_LINUX is used as a dependency for applets or features which require Linux-specific interfaces. Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: add INSERTs to *.src files where appropriateDenys Vlasenko2010-06-082-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove defconfig. Now "make defconfig" simply uses defaults from Config.inDenys Vlasenko2010-06-061-8/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mass renaming Kbuild -> Kbuild.src, Config.in -> Config.srcDenys Vlasenko2010-06-042-0/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix Config.in tab usageDenys Vlasenko2010-03-311-8/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: make maximum message length configurableJanne Kiviluoto2010-03-312-1/+11
| | | | | Signed-off-by: Janne Kiviluoto <janne.kiviluoto@bluegiga.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslog: allow multiple -R optionsThomas Geulig2010-02-281-36/+50
| | | | | | | | | function old new delta syslogd_main 1082 1177 +95 init_data 72 64 -8 Signed-off-by: Thomas Geulig <geulig@nentec.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: suppress ~60% of "aliased warnings" on gcc-4.4.1Denys Vlasenko2010-02-041-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslog: remove stray umask(0)Denys Vlasenko2010-01-291-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove some uses of argcDenys Vlasenko2010-01-041-3/+2
| | | | | | | | | | | | | | | | | | | | | | | function old new delta whoami_main 34 37 +3 logname_main 60 63 +3 hostid_main 35 38 +3 ttysize_main 136 135 -1 nmeter_main 673 672 -1 logger_main 387 386 -1 uuencode_main 330 328 -2 ifupdown_main 2125 2123 -2 mesg_main 158 155 -3 free_main 333 330 -3 cal_main 902 899 -3 acpid_main 443 440 -3 ar_main 196 189 -7 find_main 476 467 -9 ifconfig_main 1235 1221 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/12 up/down: 9/-49) Total: -40 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use ffulsh_all()Denys Vlasenko2009-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | function old new delta buffer_fill_and_print 179 196 +17 fflush_all - 9 +9 spawn 87 92 +5 rtcwake_main 455 453 -2 ... alarm_intr 93 84 -9 readcmd 1072 1062 -10 bb_ask 345 333 -12 more_main 845 832 -13 flush_stdout_stderr 42 23 -19 xfflush_stdout 27 - -27 flush_stderr 30 - -30 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397) Total: -366 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more portability fixes by Dan FandrichDenys Vlasenko2009-09-231-1/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: added comment, no code changesDenis Vlasenko2009-04-221-0/+2
|
* *: mass renaming of USE_XXXX to IF_XXXXDenis Vlasenko2009-04-211-28/+28
| | | | | | and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
* syslogd: create logfile with 0666, not 0600.Denis Vlasenko2009-03-021-3/+9
|
* syslogd: comment out file locking;Denis Vlasenko2008-12-091-33/+46
| | | | | | | | | | | | make signal handling syncronous (old was racy) function old new delta syslogd_main 963 1090 +127 quit_signal 96 - -96 log_locally 743 595 -148 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 127/-244) Total: -117 bytes
* libbb: password/group function helpers rewritten by Tito:Denis Vlasenko2008-12-021-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta xgetpwuid - 27 +27 uid2uname_utoa - 22 +22 gid2group_utoa - 22 +22 uid2uname - 18 +18 gid2group - 18 +18 buffer_fill_and_print 179 196 +17 print_user 12 24 +12 print_group 12 24 +12 get_cached 89 99 +10 ... print_common 134 120 -14 vlock_main 415 396 -19 logger_main 410 387 -23 crontab_main 642 609 -33 bb_getpwuid 42 - -42 bb_getgrgid 42 - -42 bb_getug 80 - -80 ------------------------------------------------------------------------------ (add/remove: 6/3 grow/shrink: 9/11 up/down: 187/-296) Total: -109 bytes
* klogd: fix small buglet in previous commitDenis Vlasenko2008-11-191-0/+1
|
* klogctl: fix a problem where we don't terminate read data with '\0'Denis Vlasenko2008-11-191-20/+17
| | | | | | | | and then misinterpret it. Code shrink while at it. function old new delta klogd_main 404 362 -42
* whitespace fixes, no code changesDenis Vlasenko2008-10-291-1/+1
|
* watchdog: WDIOC_SETTIMEOUT accepts seconds, not millisecondsDenis Vlasenko2008-10-041-28/+43
| | | | | klogd: handle many lines at once, by Steve Bennett (steveb AT workware.net.au)
* - wrap overlong lines (Cristian Ionescu-Idbohrn)Bernhard Reutner-Fischer2008-07-221-10/+10
| | | | - s/\. /. /g;# (me)
* *: rename ATTRIBUTE_XXX to just XXX.Denis Vlasenko2008-07-053-6/+6
|
* whitespace fixes. no code changesDenis Vlasenko2008-06-251-4/+3
|
* logger: "clean up" a dirty hack a bitDenis Vlasenko2008-06-115-30/+75
|
* klogd: make help text more understandableDenis Vlasenko2008-06-061-16/+17
| | | | | | | | | | | | klogd: by using a register instead of global variable, shrink code a bit function old new delta klogd_main 372 362 -10 packed_usage 24504 24486 -18 text data bss dec hex filename 808464 642 7180 816286 c749e busybox_old 808422 642 7180 816244 c7474 busybox_unstripped
* syslogd: do not error out on missing files to rotate. closes bug 3404.Denis Vlasenko2008-05-241-2/+3
|
* - use EXIT_{SUCCESS,FAILURE}. No object-code changesBernhard Reutner-Fischer2008-05-191-1/+1
|
* more of -Wall fixes from Cristian Ionescu-Idbohrn.Denis Vlasenko2008-05-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some are fixing real bugs. function old new delta syslogd_main 938 958 +20 get_signum 136 143 +7 obj_load 777 782 +5 recv_from_to 210 214 +4 get_next_block 1795 1799 +4 display_topmem_process_list 1117 1121 +4 logread_main 484 487 +3 buffer_fill_and_print 73 76 +3 kill_main 687 689 +2 ll_remember_index 240 241 +1 do_stats 452 453 +1 if_readconf 166 165 -1 display_process_list 1192 1191 -1 run_applet_and_exit 507 505 -2 print_signames 33 31 -2 parse_one_line 1092 1090 -2 find_out_spec 57 55 -2 add_ksymoops_symbols 421 419 -2 ash_main 1407 1402 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17) Total: 37 bytes