Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Journald SystemMaxUse when machine-id changes

I am using journald on an embedded system for logging to a persistant drive. The maximum stored logs are limited using the config parameter SystemMaxUse= and log rotation enabled. This works fine, until the systemd machine-id changes during software update (we flash a full system image during software update, very typical in embedded systems).

With the new machine-id journald creates a new log folder name, and ignores all previous folders. Hence the rotation mechanism ignores logs from other machine-id's and my quota is exceeded.

Does anybody know, how to include other machine-id logs into journald log rotation? Thanks...

Side note: With journalctl --merge I can read logs from other machine-id stored in the same journald log path, however the --merge option is ignored with cleanup commands like journalctl --rotate and/or jorunalctl --vacuumsize=1G

like image 648
Martin H. Avatar asked Nov 16 '25 18:11

Martin H.


1 Answers

This is so late but i have encountred exactly the same issue, the solution that i came with is: at the end of OS update i rename the existing log folders with the new machine-id, now i have no issue with that and old logs are taken into account when system rotate

like image 104
amer Avatar answered Nov 18 '25 21:11

amer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!