aboutsummaryrefslogtreecommitdiff
path: root/sysklogd/klogd.c
AgeCommit message (Collapse)Author
2016-02-01Fix compiling with musl's utmp stubsKylie McClain
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>
2015-10-18sysklogd/*: convert to new-style "one file" appletsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-05klogd: handle multi-char log levelsPeter Korsgaard
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>
2012-12-19CONFIG_PID_FILE_PATH: new configuration option for pidfile pathsAnthony G. Basile
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>
2011-06-05*: remove "Options:" string from help textsDenys Vlasenko
function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-25syslogd,klogd: better help textDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11move remaining help text from include/usage.src.hPere Orga
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-07klogd: fix the problem of delayed handling of ^C and SIGTERMDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-19klogd: do not log partial linesDenys Vlasenko
function old new delta overlapping_strcpy 15 18 +3 klogd_main 438 436 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-16*: make GNU licensing statement forms more regularDenys Vlasenko
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>
2010-08-01klogd: make it work on non-linux systemsJeremie Koenig
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>
2008-11-19klogd: fix small buglet in previous commitDenis Vlasenko
2008-11-19klogctl: fix a problem where we don't terminate read data with '\0'Denis Vlasenko
and then misinterpret it. Code shrink while at it. function old new delta klogd_main 404 362 -42
2008-10-04watchdog: WDIOC_SETTIMEOUT accepts seconds, not millisecondsDenis Vlasenko
klogd: handle many lines at once, by Steve Bennett (steveb AT workware.net.au)
2008-07-05*: rename ATTRIBUTE_XXX to just XXX.Denis Vlasenko
2008-06-06klogd: make help text more understandableDenis Vlasenko
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
2008-03-17*: add -Wunused-parameter; fix resulting breakageDenis Vlasenko
function old new delta procps_scan 1265 1298 +33 aliascmd 278 283 +5 parse_file_cmd 116 120 +4 dname_enc 373 377 +4 setcmd 90 93 +3 execcmd 57 60 +3 count_lines 72 74 +2 process_command_subs 340 339 -1 test_main 409 407 -2 mknod_main 179 177 -2 handle_incoming_and_exit 2653 2651 -2 argstr 1312 1310 -2 shiftcmd 131 128 -3 exitcmd 46 43 -3 dotcmd 297 294 -3 breakcmd 86 83 -3 evalpipe 353 349 -4 evalcommand 1180 1176 -4 evalcmd 109 105 -4 send_tree 374 369 -5 mkfifo_main 82 77 -5 evalsubshell 152 147 -5 typecmd 75 69 -6 letcmd 61 55 -6 add_cmd 1190 1183 -7 main 891 883 -8 ash_main 1415 1407 -8 parse_stream 1377 1367 -10 alloc_procps_scan 55 - -55 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148) Total: -94 bytes text data bss dec hex filename 797195 658 7428 805281 c49a1 busybox_old 797101 658 7428 805187 c4943 busybox_unstripped
2008-02-24less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)Denis Vlasenko
*: minor shrink
2008-02-16libbb: introduce bb_signals and bb_signals_recursive,Denis Vlasenko
which sets same handler for many signals. sig_catch is nuked (bb_signals_recursive is more descriptive name). *: use them as appropriate. function old new delta bb_signals_recursive - 95 +95 bb_signals - 52 +52 run_command 258 273 +15 svlogd_main 1368 1377 +9 runsv_main 1746 1752 +6 runsvdir_main 1643 1646 +3 UNSPEC_print 64 66 +2 time_main 1128 1127 -1 ... resize_main 246 210 -36 sig_catch 63 - -63 set_fatal_sighandler 85 14 -71 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 5/24 up/down: 182/-548) Total: -366 bytes
2008-01-27- fix conflicting decls of syslog related facilitynames and prioritynames tablesBernhard Reutner-Fischer
2007-11-16dmesg,klogd: make code more readableDenis Vlasenko
libbb: explain why we declare klogctl libbb: move defs around so that order makes more sense
2007-10-11add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-08-18don't pass argc in getopt32, it's superfluousDenis Vlasenko
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes text data bss dec hex filename 773469 1058 11092 785619 bfcd3 busybox_old 772644 1058 11092 784794 bf99a busybox_unstripped
2007-06-13*: BB_BANNER -> bb_banner (it is not a const or #define)!Denis Vlasenko
correct_password: explain in detail why it is ok to use bb_banner fsck_minix: make it print bb version, not it's own (outdated/irrelevant) one Marginal size difference: text data bss dec hex filename 679119 2700 15632 697451 aa46b busybox_old 679091 2700 15632 697423 aa44f busybox_unstripped
2007-05-26usage.c: remove reference to busybox.hDenis Vlasenko
*: s/include "busybox.h"/include "libbb.h"
2007-03-26move everything to new NOMMU helpers, except udhcpDenis Vlasenko
2007-03-24NOMMU re-exec trick shuld not depend on existence of "don't daemonize"Denis Vlasenko
option for every affected applet (and dnsd, for example, don't have one). Thus rework re-exec support to not require it. Code got smaller too.
2007-02-17klogd: code de-obfuscation with small code size reductionDenis Vlasenko
2007-02-03suppress warnings about easch <applet>_main() havingDenis Vlasenko
no preceding prototype
2007-01-09- shrink klogd a tiny bit.Bernhard Reutner-Fischer
Compile tested only, would have sent it to the list for review but they don't show up in the ML archives :-/ text data bss dec hex filename 533 0 0 533 215 sysklogd/klogd.o.orig 530 0 0 530 212 sysklogd/klogd.o
2007-01-04klogd: small optimizationsDenis Vlasenko
(btw, I looked into syslogd... that's frightening!)
2006-10-08attempt to regularize atoi mess.Denis Vlasenko
2006-10-03getopt_ulflags -> getopt32.Denis Vlasenko
It is impossible to formulate sane ABI based on size of ulong because it can be 32-bit or 64-bit. Basically it means that you cannot portably use more that 32 option chars in one call anyway... Make it explicit.
2006-08-03Remove bb_ prefixes from xfuncs.c (and a few other places), consolidateRob Landley
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
2006-06-02- move #include busybox.h to the very top so we pull in the configBernhard Reutner-Fischer
and eventual platform specific includes in early.
2006-05-31- shrink klogd a bitBernhard Reutner-Fischer
text data bss dec hex filename 569 0 0 569 239 sysklogd/klogd.o.orig 537 0 0 537 219 sysklogd/klogd.o
2006-05-31- s/defined(__uClinux__)/BB_NOMMU/Bernhard Reutner-Fischer
This needs a second pass to: + add bb_daemon(unsigned char no_chdir, unsigned char no_close, const char*flag) + eventually globally export argc and argv, so we don't need to pass it to bb_daemon().
2006-05-19- remove emacs layout block as suggested by Robert P.J. DayBernhard Reutner-Fischer
- use shorter boilerplate while at it
2006-04-12- patch from Denis Vlasenko to add and use bb_xdaemon()Bernhard Reutner-Fischer
2006-03-06Robert P. Day removed 8 gazillion occurrences of "extern" on functionRob Landley
definitions. (That should only be on prototypes.)
2006-02-16moved BB_BANNER to applets/version.c file: make kernel like version, "Vladimir N. Oleynik"
removed depend loop: busybox.h depend with BB_BT, and all sources depend with busybox.h
2006-01-22- add platform.h.Bernhard Reutner-Fischer
- use shorter boilerplate while at it.
2005-09-14Cleanup patch from tito: migrate option parsing to the bb_ functions and fixRob Landley
types.
2004-08-06Part of patch from William Barsse, fixes a problem with unescaped %.Glenn L McGrath
2004-06-25Do not mess with the console logging level unlessEric Andersen
asked to do so. -Erik
2004-06-22Patch from Bastian Blank:Eric Andersen
On Sat, Jun 19, 2004 at 10:57:37PM +0200, Bastian Blank wrote: > The following patch changes klogd to use openlog/syslog themself > instead of calling syslog_msg which always calls the triple > openlog/syslog/closelog. Updated patch: get rid of syslog_msg entirely. Request from Erik Andersen. Bastian
2004-03-15Remove trailing whitespace. Update copyright to include 2004.Eric Andersen
2003-12-15Get vfork_daemon_rexec working under uclinuxRuss Dill
2003-07-28Fixup bugs in last patchEric Andersen
2003-07-28last_patch95 from vodz:Eric Andersen
Hi. Last patch have new libbb function vfork_rexec() for can use daemon() to uClinux system. This patched daemons: syslog, klogd, inetd, crond. This not tested! I havn`t this systems. Also. Previous patch for feature request MD5 crypt password for httpd don`t sended to this mailist on 07/15/03 (mailist have Pytom module problem?). The previous patch included, and have testing. --w vodz