]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal: explicitly sync namespaced journals before stopping socket units
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 1 May 2024 21:18:52 +0000 (06:18 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 2 May 2024 17:41:01 +0000 (19:41 +0200)
commit61628287bd6d5115d96a4bdbd70964efd7a5940e
tree074de36502c308dc99d884a0b53826d404737fb5
parent5cd6605737b867a972392f83c0607af19f8bcf51
journal: explicitly sync namespaced journals before stopping socket units

Otherwise, if a service unit that requests LogNamespace= stopped before
systemd-journald@.service is started, logs generated by the service will be
lost, as systemd-journald@.socket is stopped and
systemd-journald@.service will never started.

To prevent the issue, let's introduce another implicit dependency to
a oneshot service that explicitly synchronizes a namespaced journal file
when the log namespace is not needed anymore.

Fixes #32604.
src/core/unit.c
units/meson.build
units/systemd-journald-sync@.service [new file with mode: 0644]