Re: [DNG] bootlogd: /var/log/boot does not get rotated SOLVED

2019-03-03 Thread Stefan Krusche
Am Samstag, 2. März 2019 schrieb KatolaZ:
> > 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"
>
> Dear Stefan,
>
> bootlogd only replaces /var/log/boot~ if it is given the option "-r"
> (see the bootlogd manpage). It looks like this option is missing from
> BOOTLOGD_OPTS above. It should be sufficient to add "-r" there. 

Dear KatolaZ,

thanks for pointing out, I seem to have overlooked that one.

> This 
> means that you would only keep the log for the last two boots,
> though.

Yes, sure.

> Another possibility would be to have a logrotate config file for
> that, and keep as many logs as you want.

Yes, alright.  I have done that before, no problem.

I've been expecting it to be default to rotate logs (or copy to ~) 
as it is the case with most other programs from my experience and not 
to have to edit an init script to get bootlogd to rotate its logs 
myself (only after having noticed it has grown overly).  That's why I 
thought something might be wrong here.

Thank you.

Kind regards,
Stefan
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] bootlogd: /var/log/boot does not get rotated

2019-03-02 Thread KatolaZ
On Sat, Mar 02, 2019 at 05:06:10PM +0100, Stefan Krusche wrote:
> 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"
> 

Dear Stefan,

bootlogd only replaces /var/log/boot~ if it is given the option "-r"
(see the bootlogd manpage). It looks like this option is missing from
BOOTLOGD_OPTS above. It should be sufficient to add "-r" there. This
means that you would only keep the log for the last two boots, though.

Another possibility would be to have a logrotate config file for that,
and keep as many logs as you want.

HTH

KatolaZ

-- 
[ ~.,_  Enzo Nicosia aka KatolaZ - Devuan -- Freaknet Medialab  ]  
[ "+.  katolaz [at] freaknet.org --- katolaz [at] yahoo.it  ]
[   @)   http://kalos.mine.nu ---  Devuan GNU + Linux User  ]
[ @@)  http://maths.qmul.ac.uk/~vnicosia --  GPG: 0B5F062F  ] 
[ (@@@)  Twitter: @KatolaZ - skype: katolaz -- github: KatolaZ  ]


signature.asc
Description: PGP signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] bootlogd: /var/log/boot does not get rotated

2019-03-02 Thread Stefan Krusche
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
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] bootlogd: /var/log/boot does not get rotated

2019-03-02 Thread KatolaZ
On Sat, Mar 02, 2019 at 03:28:31PM +0100, Stefan Krusche wrote:
> Good day everyone,
> 
> the file /var/log/boot on my system has now grown up to more than 1.2MB. 
> It never got rotated since I installed this system (~ June 2018).
> 
> I looked into /etc/init.d/bootlogd and there's apparently some code to 
> rotate /var/log/boot under the "stop)" clause of the "case $ACTION" 
> construct which does a check first (line 66):
> 
> if [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
> then
> […]
> 
> after which the code follows which is supposed to rotate /var/log/boot 
> IIUC.
> 
> /var/log/boot~ doesn't exist. It obviously never had been created and 
> therefore /var/log/boot isn't rotated, I think.
> 
> I assume this to be a bug, but as I'm not familiar with the 
> particularities of init scripts, I'd like to ask for your opinions 
> about that issue here.
>

Stefan, bootlogd will always log the current boot in /var/log/boot
after having renamed it into /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.

HTH

KatolaZ

-- 
[ ~.,_  Enzo Nicosia aka KatolaZ - Devuan -- Freaknet Medialab  ]  
[ "+.  katolaz [at] freaknet.org --- katolaz [at] yahoo.it  ]
[   @)   http://kalos.mine.nu ---  Devuan GNU + Linux User  ]
[ @@)  http://maths.qmul.ac.uk/~vnicosia --  GPG: 0B5F062F  ] 
[ (@@@)  Twitter: @KatolaZ - skype: katolaz -- github: KatolaZ  ]


signature.asc
Description: PGP signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] bootlogd: /var/log/boot does not get rotated

2019-03-02 Thread Stefan Krusche
Good day everyone,

the file /var/log/boot on my system has now grown up to more than 1.2MB. 
It never got rotated since I installed this system (~ June 2018).

I looked into /etc/init.d/bootlogd and there's apparently some code to 
rotate /var/log/boot under the "stop)" clause of the "case $ACTION" 
construct which does a check first (line 66):

if [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
then
[…]

after which the code follows which is supposed to rotate /var/log/boot 
IIUC.

/var/log/boot~ doesn't exist. It obviously never had been created and 
therefore /var/log/boot isn't rotated, I think.

I assume this to be a bug, but as I'm not familiar with the 
particularities of init scripts, I'd like to ask for your opinions 
about that issue here.

Kind regards,
Stefan


Package: bootlogd
Version: 2.88dsf-59.9+devuan2
Severity: wishlist

-- System Information:
Distributor ID: Devuan
Description:Devuan GNU/Linux 2.0 (ascii)
Release:2.0
Codename:   ascii

Architecture: x86_64

Kernel: Linux 4.9.0-8-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages bootlogd depends on:
ii  libc6 2.24-11+deb9u4
ii  lsb-base  4.1+devuan2
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng