0

My embedded box is running Linux 5.15 with systemd 251 (251.2+). I have configured persistent logging for journal.

/etc/systemd/journald.conf
[Journal]
Storage=persistent

Created folder /var/log/journal. This is mounted on mtd flash partition.

ls -alt /var/log/journal/
drwxr-sr-x    2 root     systemd-         0 Jan  1 00:03 2b4305f670484d1fa6b9c4deee336b91

Jouranld creates a folder under /var/log/journal but I dont see anything getting stored here ever. I don't see journal being persistent across reboots.

Journal logs are kept only in /run/log/journal and this is tmpfs in the system and gets erased on each reboot.

I have tried journalctl --flush to see if anything gets pushed to inside /var/log/journal but nothing is stored apart form the folder name. journalctl --rotate also has no impact.

I seem to be doing everything as per the journalctl documentation but still its not working. Any help?

Rohit Pai
  • 21
  • 3
  • Check [this](https://unix.stackexchange.com/q/191313/414186). Not sure if it will be helpful. According to the thread the problem is about `machine-id`. Maybe [the Maluvel's answer](https://unix.stackexchange.com/a/624653/414186) is more useful. – Edgar Magallon Nov 30 '22 at 21:47
  • the machine-id remains the same in my case. I came cross the thread. – Rohit Pai Dec 01 '22 at 05:28
  • You said that `/var/log/journal` is mounted on mtd flash partition, right? What is its filesystem? I'm not really sure if the filesystem type is relevant for this but it should be useful to check that. – Edgar Magallon Dec 02 '22 at 04:13
  • Its jffs2. It could be file system limitation. I have requested confirmation [here](https://github.com/systemd/systemd/issues/25712) – Rohit Pai Dec 14 '22 at 04:34

1 Answers1

2

The file system in our case is jffs2. Persistent journal would not work on jffs2. More details are in my Github systemd issue #2571.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Rohit Pai
  • 21
  • 3