:: Re: [DNG] bootlogd: /var/log/boot d…
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Stefan Krusche
Datum:  
To: dng
Betreff: Re: [DNG] bootlogd: /var/log/boot does not get rotated
Hi KatolaZ,

thank you for the quick reply.

Am Samstag, 2. März 2019 schrieb KatolaZ:
> Stefan, bootlogd will always log the current boot in /var/log/boot
> after having renamed it into /var/log/boot~.


Yes, makes sense. Unfortunately this is not happening on my system.

$ ls -l /var/log/boo*
-rw-r----- 1 root adm 1239019 Mär 2 11:27 /var/log/boot

> In this way you always
> have the log of the current boot in /var/log/boot and the log of the
> previous one in /var/log/boot~. So there should be no need to rotate
> them.


I only have looked into /etc/init.d/bootlogd so far. The copied code
snippets (with line numbers) tell me that bootlogd logs
to /run/bootlog:

16 TMPLOG=/run/bootlog

20 BOOTLOGD_OPTS="-c -l $TMPLOG"

45             start-stop-daemon --start --quiet --exec $DAEMON -- \
46             $BOOTLOGD_OPTS


Then the /run/log is appended to /var/log/boot:

63         cat "$TMPLOG" >> /var/log/boot


So far so good, but nowhere /var/log/boot~ is being created, at least
not in /etc/init.d/bootlogd AFAICT.

Then there follows the mentioned code block which apparently *should*
rotate /etc/init.d/bootlogd but only if both /var/log/boot
and /var/log/boot~ already exist IIUC.

Lines 66-78:

    if [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
    then
        [ "$VERBOSE" = no ] || log_action_begin_msg "Moving boot log 
file"
        # bootlogd writes to boot, making backup at boot~
        cd /var/log && {
            chgrp adm boot || :
            savelog -q -p -c 5 boot \
            && mv boot.0 boot \
            && mv boot~ boot.0
        }
        ES=$?
        [ "$VERBOSE" = no ] || log_action_end_msg $ES
    fi


Well, I can only say I probably don't understand how all of it works and
what else is involved in creating/copying /var/log/boot
to /var/log/boot~ (haven't looked into initrd) but this looks kinda
weird to me.

It's not a big issue but I'm really curious what is going wrong here.

Thanks and kind regards,
Stefan