White Paper: Initscripts & logging


< Prev Contents Next >

Common Questions

Why not just log to syslogd?
Simply put, during the majority of the bootup process, syslogd isn't running. Furthermore, starting it sooner won't catch some messages, as syslogd requires writable / and /var/log directories.
Why don't you just write directly to a log file, instead of waiting for syslogd?
During the boot process, there could be multiple instances of logging going on simultaneously. To correcty do this would require implementing file locking in whatever was writing the log files, and was deemed to be an unneccessary complication. Additionally, by using syslogd to record all messages, this allows for forwarding of messages to different log files, network hosts, certain users, and other options.
So what exactly is this [ OK ] / [ FAILED ] stuff, anyways?
In the process of doing this logging, we are keeping track of whether all the services/actions succeed or fail. It was decided that service successes or failures should be easily detectable by the user, as well as changing the appearance of the bootup process from the "ungodly holy mess of hackery that it is". Basically, everything that will be logged as 'succeeded' gets an [ OK ], everything that will be logged as 'failed' gets a [FAILED]. [PASSED] is currently a special case used for successful filesystem checks.
That's nice. How do I turn it off?
If you edit /etc/sysconfig/init, you can change the behavior of the bootup process. The BOOTUP variable is the most useful one currently available. It supports the following settings:
color
the new, Red Hat 6.0 style bootup.
verbose
the old, Red Hat 5.2 style bootup.
serial (or currently, anything else)
the new style bootup, but with no screen escapes for color or cursor positioning. Mostly useful for serial consoles and the like.
More keywords may be defined as time goes on. Additionally, through customizing the other variables present, you can change (for example) what column to move to before printing a label, or the colors/formatting used. For example, by editing the 'SETCOLOR_FAILURE' variable, it could be possible to make all failures blink. In any event, everything will still be logged.
I get these strange messages from nfsd/apmd that screw up the formatting. What's up with that?
These messages are messages from syslog and/or kernel messages that are a high enough priority that they are echoed to the screen. When the bootup starts, the initial console loglevel is set to 1 (nothing but emergency messages) via the loglevel program. However, once klogd and syslogd start, this behavior is determined by their configuration. In general, the simple solution is to patch the offending code if it bothers you.
Service foo hangs every time I boot - can I boot without it?
Yes; just type in linux confirm at the boot prompt, and you will be asked for confirmation before starting services.
Why aren't the messages in order?
This can't really be avoided. What happens at boot is:
  1. console-message/etc. -> buffered until syslogd starts
  2. kernel messages -> buffered until klogd starts
Then, when syslogd starts, buffer #1 is dumped to it; at the same time klogd starts and dumps buffer #2; meanwhile, the bootup process continues, possibly generating more messages. Hence, the logs can end up somewhat jumbled. Another minor issue is that the timestamps will change on the messages if the time is reset during the install (via timezone changes, or somesuch).

< Prev Contents Next >