7

I'm running Debian wheezy. Many scripts in /etc/init.d/ use various logging functions defined in the Linux Standard Base, like log_success_msg and log_warning_msg. The LSB documentation seems a bit ambiguous as to exactly what these functions should do:

The log_success_msg function shall cause the system to write a success message to an unspecified log file. The format of the message is unspecified. The log_success_msg function may also write a message to the standard output.

However, I guess this is interpreted as meaning that the functions can either write to a log file or just write to standard output. It seems that on Debian at least, it just causes a message to be written to standard output. My suspicions were confirmed when I checked out the file defining these functions, /lib/lsb/init-functions - it just calls echo to display any log message.

This is not helpful behaviour. Text written on boot to standard output disappears shortly after boot is complete, and may well scroll off the top of the screen in any case. Surely it would be far more helpful if these messages were actually stored in a log file; in fact I don't even see the point of logging anything via these functions if they are only going to go to standard output.

Is there any way to get these logs going to a file? Can anyone enlighten me as to why you would bother "logging" anything only to standard output? What helpful function does it serve?

  • My reading of that is that logging the message to disk is mandatory, and repeating it to stdout is an optional extra. If you're right about the Debian behaviour, it looks to me as if Debian is not compliant. – James Youngman Jul 12 '12 at 7:02
5

It looks like the solution is to install bootlogd and put

BOOTLOGD_ENABLE=yes

in /etc/default/bootlogd.

References:

  • 1
    Thanks, this worked nicely! They actually changed it from Debian squeeze to wheezy. In squeeze, bootlogd was installed by default and you just had to edit /etc/default/bootlogd and set BOOTLOGD_ENABLE=yes. In wheezy, they moved bootlogd into a separate package so you install the bootlogd package; with that package installed, it always logs boot output to /var/log/boot, and you don't need to edit any config file. – Jez Jul 11 '12 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.