aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-03-11 14:40:00 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-03-11 14:40:00 +0000
commita19e64933c600b7f05232ad80bb5db85c115e42d (patch)
treebb832b3fc677066c155b19eaccea085298b1b718 /docs
parent4774179cb9e04030485773adf2b7b1055a10faeb (diff)
downloadbusybox-w32-a19e64933c600b7f05232ad80bb5db85c115e42d.tar.gz
busybox-w32-a19e64933c600b7f05232ad80bb5db85c115e42d.tar.bz2
busybox-w32-a19e64933c600b7f05232ad80bb5db85c115e42d.zip
docs/logging_and_backgrounding.txt: new mini-doc
dnsd: remove statics, remove nerly-useless SIGINT handler crond: correct more of logfile to 0666 (as usual, umask allows user to remove unwanted bits). nameif: print errors to stderr too, not just to syslog function old new delta udhcp_read_interface 308 306 -2 ttl 4 - -4 fileconf 4 - -4 dnsentry 4 - -4 interrupt 19 - -19 dnsd_main 1463 1394 -69 ------------------------------------------------------------------------------ (add/remove: 0/4 grow/shrink: 0/2 up/down: 0/-102) Total: -102 bytes text data bss dec hex filename 808161 476 7864 816501 c7575 busybox_old 807994 468 7856 816318 c74be busybox_unstripped
Diffstat (limited to 'docs')
-rw-r--r--docs/logging_and_backgrounding.txt89
1 files changed, 89 insertions, 0 deletions
diff --git a/docs/logging_and_backgrounding.txt b/docs/logging_and_backgrounding.txt
new file mode 100644
index 000000000..39f015883
--- /dev/null
+++ b/docs/logging_and_backgrounding.txt
@@ -0,0 +1,89 @@
1 Logging and backgrounding
2
3By default, bb_[p]error_msg[_and_die] messages go to stderr,
4and of course, usually applets do not auto-background. :)
5
6Historically, daemons and inetd services are different.
7
8Busybox is trying to provide compatible behavior, thus if an applet
9is emulating an existing utility, it should mimic it. If utility
10auto-backgrounds itself, busybox applet should do the same.
11If utility normally logs to syslog, busybox applet should do
12the same too.
13
14However, busybox should not needlessly restrict the freedom
15of the users. And users have different needs and different preferences.
16Some might like logging everything from daemons to syslog.
17Others prefer running stuff under runsv/svlogd and thus would like
18logging to stderr and no daemonization.
19
20To help with that, busybox applets should have options to override
21default behavior, whatever that is for a given applet.
22
23
24Current sutiation is a bit of a mess:
25
26acpid - auto-backgrounds unless -d
27crond - auto-backgrounds unless -f, logs to syslog unless -d or -L.
28 option -d logs to stderr, -L FILE logs to FILE
29devfsd - (obsolete)
30dnsd - option -d makes it auto-background and log to syslog
31fakeidentd - inetd service. Auto-backgrounds and logs to syslog
32 if no -f and no -i and no -w (-i is "inetd service" flag,
33 -w is "inetd-wait service" flag)
34ftpd - inetd service. Logs to syslog always, with -v logs to strerr too
35httpd - auto-backgrounds unless -f or -i
36 (-i is "inetd service" flag)
37inetd - auto-backgrounds unless -f, logs to syslog unless -e
38klogd - auto-backgrounds unless -n
39syslogd - auto-backgrounds unless -n
40telnetd - auto-backgrounds unless -f or -i
41 (-i is "inetd service" flag)
42udhcpc - auto-backgrounds unless -f after lease is obtained,
43 option -b makes it background sooner (when lease attempt
44 fails and retries start),
45 after backgrounding it stops logging to stderr;
46 logs to stderr, but option -S makes it log *also* to syslog
47udhcpd - auto-backgrounds and do not log to stderr unless -f,
48 otherwise logs to stderr, but option -S makes it log *also* to syslog
49zcip - auto-backgrounds and logs *also* to syslog unless -f
50
51miscutils/crond.c: logmode = LOGMODE_SYSLOG;
52networking/dnsd.c: logmode = LOGMODE_SYSLOG;
53networking/ftpd.c: logmode = LOGMODE_SYSLOG;
54networking/ftpd.c: logmode |= LOGMODE_SYSLOG;
55networking/inetd.c: logmode = LOGMODE_SYSLOG;
56networking/isrv_identd.c: logmode = LOGMODE_SYSLOG;
57networking/telnetd.c: logmode = LOGMODE_SYSLOG;
58networking/udhcp/dhcpc.c: logmode = LOGMODE_NONE;
59networking/udhcp/dhcpc.c: logmode |= LOGMODE_SYSLOG;
60networking/udhcp/dhcpc.c: logmode &= ~LOGMODE_STDIO;
61networking/udhcp/dhcpd.c: logmode = LOGMODE_NONE;
62networking/udhcp/dhcpd.c: logmode |= LOGMODE_SYSLOG;
63networking/zcip.c: logmode |= LOGMODE_SYSLOG;
64
65
66These daemons seem to never auto-background/log to syslog:
67
68lpd - inetd service. Has nothing to log so far, though
69dhcprelay - standard behavior
70inotifyd - standard behavior
71runsv - standard behavior
72runsvdir - standard behavior
73svlogd - standard behavior
74tcpsvd, udpsvd - standard behavior
75tftpd - standard behavior
76
77
78Non-daemons (seems to be use syslog for a good reason):
79
80networking/nameif.c: logmode |= LOGMODE_SYSLOG;
81loginutils/chpasswd.c: logmode = LOGMODE_BOTH;
82loginutils/chpasswd.c: logmode = LOGMODE_STDIO;
83loginutils/getty.c: logmode = LOGMODE_BOTH;
84loginutils/getty.c: logmode = LOGMODE_NONE;
85loginutils/passwd.c: logmode = LOGMODE_STDIO;
86loginutils/passwd.c: logmode = LOGMODE_BOTH;
87loginutils/sulogin.c: logmode = LOGMODE_SYSLOG; (used if stdio isn't a tty)
88loginutils/sulogin.c: logmode = LOGMODE_BOTH;
89util-linux/mount.c: logmode = LOGMODE_SYSLOG; (used in a backgrounded NFS mount helper)