2

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

Martin H.
  • 185
  • 2
  • 16
  • I was looking into hardcoding the machine-id into the device image from factory, so that it stays constant over software updates. However this would imply the same machine-id in the full product line. This is discouraged by systemd, see for example: https://github.com/systemd/systemd/issues/9609 – Martin H. Apr 07 '21 at 13:45
  • Did you ever find a solution? – Kreuzade Sep 28 '21 at 17:47
  • @Kreuzade unfortunately not. As mitigation I erase all journald logs when running a software update. Quota over logs unfortunately on embedded devices with limited storage and unsupervised operations. – Martin H. Oct 06 '21 at 11:38
  • Maybe this is a solution...? https://stackoverflow.com/questions/68744130/is-there-a-way-to-create-a-link-for-the-machine-id-without-modifying-yocto/68779616#68779616 – Martin H. Oct 25 '21 at 16:39

0 Answers0