]> git.ipfire.org Git - thirdparty/systemd.git/commit
journald: don't flush to /var/log/journal before we get asked to
authorLennart Poettering <lennart@poettering.net>
Mon, 12 Dec 2016 19:54:45 +0000 (20:54 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Dec 2016 18:09:29 +0000 (19:09 +0100)
commitf78273c8dacf678cc8fd7387f678e6344a99405c
tree51243cc362b2ba567f3d7ad8f4e6d77f78fee919
parent4ad14eff19f644fe632adf6ecc292a8e88540801
journald: don't flush to /var/log/journal before we get asked to

This changes journald to not write to /var/log/journal until it received
SIGUSR1 for the first time, thus having been requested to flush the runtime
journal to disk.

This makes the journal work nicer with systems which have the root file system
writable early, but still need to rearrange /var before journald should start
writing and creating files to it, for example because ACLs need to be applied
first, or because /var is to be mounted from another file system, NFS or tmpfs
(as is the case for systemd.volatile=state).

Before this change we required setupts with /var split out to mount the root
disk read-only early on, and ship an /etc/fstab that remounted it writable only
after having placed /var at the right place. But even that was racy for various
preparations as journald might end up accessing the file system before it was
entirely set up, as soon as it was writable.

With this change we make scheduling when to start writing to /var/log/journal
explicit. This means persistent mode now requires
systemd-journal-flush.service in the mix to work, as otherwise journald would
never write to the directory.

See: #1397
src/journal/journald-server.c
src/journal/journald-server.h
src/journal/journald.c