You are not logged in.

#1 2015-08-02 01:08:01

steelcowboy
Member
From: California, USA
Registered: 2014-09-04
Posts: 48

Systemd race condition with /var

So after trying to figure it out for the longest time, I finally know what's going on with my system journal.

I have /var on my HDD while / is on my SSD. When I boot up it seems that the systemd-journald is starting before var is mounted. I fixed this issue by modifying /usr/lib/systemd/system/systemd-journald.service and adding var.mount to the After= section. After this modification, journald will successfully write to /var/log/journal/fb0cfc4d61a346a5b9bcff2a6f8eb362. 

Another thing I tried which did NOT fix the problem was setting "Storage=persistent" in /etc/systemd/journal.conf. So basically now the problem is fixed, but my question is was this the best way to fix it?

On a semi-related note, when I ran journalctl as a user I'd get the full output and systemctl status <unit> would show me messages from system units. Now journalctl only shows my user services and systemctl status on system units shows

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Is this new? I wouldn't know, my system journal hasn't worked since July 19th tongue

Thanks!

Last edited by steelcowboy (2015-08-02 01:09:09)

Offline

#2 2015-08-02 09:12:55

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Systemd race condition with /var

If you modify /usr/lib/systemd/system/systemd-journald.service, this will be overwritten at the next systemd update.
To prevent this, follow what is explained in 'man systemd.unit':

Along with a unit file foo.service, a directory foo.service.d/ may exist. All files with the suffix ".conf" from this
directory will be parsed after the file itself is parsed. This is useful to alter or add configuration settings to a unit,
without having to modify their unit files. Make sure that the file that is included has the appropriate section headers
before any directive.

About your other point, if you are not a member of the systemd-journal group, you see only the user journal content when you use journalctl.

The warning message seems to mean that some messages may have been lost or incompletely written during the rotation time.
But journalctl will read all the rotated files and show all the messages in them with the actual journal content.

Last edited by berbae (2015-08-02 09:14:50)

Offline

Board footer

Powered by FluxBB