The snap I maintain gathers info from the system to send bug reports to Launchpad.
After bringing a few fixes to make the snap able to run on 22.04 systems, I found that the journalctl log from previous boot was missing when running the snap on a 22.04 system. Normally, to gather this, the snap runs
journalctl -b -1 -k.
The snap is built with
core18 base snap, which bundles journalctl v237. Systems running 22.04 are running journalctl v249. When the snap tries to run journalctl 237 to retrieve journal logs created with journalctl 249, it fails with following error:
Journal file xxx.journal has unknown incompatible flags 0xc Failed to open journal file xxx.journal: Protocol not supported mmap cache statistics: 0 hit, 1 miss Failed to open files: Protocol not supported
Same problem when trying to open the same journal log file using journalctl 245, so switching the snap to
core20 base snap would not help.
I tried to run the host journalctl from within the snap, but it segfaults:
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/lib/snapd/hostfs/usr/lib/systemd/:/var/lib/snapd/hostfs/usr/lib/x86_64-linux-gnu/ /var/lib/snapd/hostfs/bin/journalctl Segmentation fault (core dumped)
And, for now, there is no official core22 base snap available…
I’m not exactly sure what the root cause is (I quickly went through systemd changelog, but there are just too many things…) and if there is any way I could somehow get the content of the previous boot log from within my snap, regardless of the host system version?
Thanks in advance!