aboutsummaryrefslogtreecommitdiff
path: root/sysklogd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* syslogd: minor tweaks to textMike Frysinger2016-04-041-2/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Fix compiling with musl's utmp stubsKylie McClain2016-02-011-1/+0
| | | | | | | | | | | | | | | | | | | This patch fixes compiling busybox with FEATURE_UTMP and _WTMP enabled. musl, while not really support utmp/wtmp, provides stub functions, as well as variables such as _PATH_UTMP, so that programs using utmp or wtmp can still compile fine. My reasoning for this patch is that on Exherbo, I'm currently trying to get us to be able to use the same busybox config file for both glibc and musl systems, using utmp/wtmp on systems that support it, and using the stubs on musl without needing two different configs. As of latest musl git, it provides all utmp functions needed; 1.1.12 doesn't, but I sent a patch to Rich to add the utmp{,x}name functions expected to exist, which was merged into musl upstream. Signed-off-by: Kylie McClain <somasissounds@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove systemd supportDenys Vlasenko2015-10-221-5/+0
| | | | | | | systemd people are not willing to play nice with the rest of the world. Therefore there is no reason for the rest of the world to cooperate with them. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sysklogd/*: convert to new-style "one file" appletsDenys Vlasenko2015-10-186-163/+172
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Removes stray empty line from codeManinder Singh2015-07-131-1/+0
| | | | | | | | | This patch removes stray empty line from busybox code reported by script find_stray_empty_lines Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* logread: implement dumpfollow mode of operationPhil Sutter2015-03-221-5/+11
| | | | | | | | | | | | | This is basically a combination of the default (dump mode) and -f (follow mode). Specifying -F makes logread first dump the log buffer and then immediately start following it. function old new delta packed_usage 30412 30443 +31 logread_main 491 497 +6 Signed-off-by: Phil Sutter <phil.sutter@viprinet.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: make "reopen log file every second" logic work for multiple logsJoshua Judson Rosen2014-07-031-6/+7
| | | | | | | | | | | Move last_log_time from a single global to *each logFile_t* so that we can actually apply the logic to every log-file in multi-file configurations, rather than working only for the first file written in each 1-second interval and then leaving the others connected to possibly wrong files. Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: syslogd: don't *decrement* log_file->size on write failuresJoshua Judson Rosen2014-07-021-3/+8
| | | | | | | | Even if we fail to write to a log-file, and it's not growing, it's not *shrinking* either.... Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: make "-O -" log to stdoutDenys Vlasenko2014-07-021-36/+45
| | | | | | | | | | | function old new delta packed_usage 29871 29908 +37 log_locally 404 440 +36 syslogd_main 1966 1956 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 73/-10) Total: 63 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: Unify unlink/truncate + unlock log-rotation logicJoshua Judson Rosen2014-06-021-19/+11
| | | | | | | | | Always unlink + reopen, rather than sometimes using ftruncate(); using a single code-path reduces the opportunity for either mistakes or duplicate code. Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: remember to un-writelock log-files even when called with "-b 0"Joshua Judson Rosen2014-06-021-0/+4
| | | | | Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: avoid spurious ftrunctate() calls for "-b 0"Joshua Judson Rosen2014-06-021-0/+6
| | | | | | | | | Forgetting to re-set log_file->size after truncating to zero discards log-data for the next 1 second following an oversize-induced purge, when we shouldn't necessarily throw that data away. Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Use unsigned printf/scanf conversion where more appropriateDenys Vlasenko2013-11-291-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* logread: don't call shmdt() before exit, kernel does it for us.Denys Vlasenko2013-11-261-4/+9
| | | | | | | | | | | function old new delta logread_main 472 466 -6 interrupted 20 9 -11 error_exit 20 - -20 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-37) Total: -37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* logread: flush output. closes 6710Denys Vlasenko2013-11-261-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: use _PATH_LOG when availableCédric Cabessa2013-08-051-4/+7
| | | | | Signed-off-by: Cédric Cabessa <ccabessa@genymobile.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* logread: intercept all fatal signals, not just SIGINTDenys Vlasenko2013-07-281-5/+4
| | | | | | | function old new delta interrupted 27 20 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sysklogd: trim help textDenys Vlasenko2013-03-151-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: do not segfault on parse error when using default config. Closes 5762Denys Vlasenko2013-01-201-1/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslogd: convert dummy functions to statics and get rid of IF_FEATURE_* checksPeter Korsgaard2013-01-181-12/+10
| | | | | | | | | As suggested by Mike. No bloat-o-meter difference, but a bit nicer to look at. We cannot convert the call to log_to_shmem() as it checks for G.shbuf outside the function, and G.shbuf is only available when IPC support is enabled. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* 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>