Artix Linux Forum

Artix Linux => System => Topic started by: Hurricane on 10 August 2023, 11:27:21

Title: I'd like to keep the previous dmesg.log after a reboot.
Post by: Hurricane on 10 August 2023, 11:27:21
If the machine crashes, I'd like to be able to read any kernel panic or other issue.
However, after a reboot, only the current one is available.

Is there a way to keep the previous one?

Thanks.
Title: Re: I'd like to keep the previous dmesg.log after a reboot.
Post by: nous on 10 August 2023, 11:56:27
Both metalog and syslog-ng can log everything, including dmesg, if configured so. Otherwise, here's a quick'n'dirty hack you can put in rc.local:
Code: [Select]
dmesg -wHT >>/var/log/dmesg-prev.log &

[EDIT reason: added '&']
Title: Re: I'd like to keep the previous dmesg.log after a reboot.
Post by: Hurricane on 10 August 2023, 18:38:44
Thanks.
Title: Re: I'd like to keep the previous dmesg.log after a reboot.
Post by: engineer on 07 November 2024, 21:05:13
This is an option in bootmisc.
Edit /etc/conf.d/bootmisc to set

log_dmesg="yes"
previous_dmesg="yes"
Title: Re: I'd like to keep the previous dmesg.log after a reboot.
Post by: LemonPie on 09 November 2024, 01:38:23
This is an option in bootmisc.
Edit /etc/conf.d/bootmisc to set

log_dmesg="yes"
previous_dmesg="yes"

part of openrc.
Title: Re: I'd like to keep the previous dmesg.log after a reboot.
Post by: eric-dev on 23 February 2025, 03:38:54
Ah so this won't work with runit? Do you know if there is any built in solution? I suppose I could set up log rotation in `/etc/logrotate.conf` or `/etc/logrotate.d`