]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: copy the host's os-release for /run/host/os-release
authorLuca Boccassi <bluca@debian.org>
Tue, 18 Jul 2023 14:44:27 +0000 (15:44 +0100)
committerLuca Boccassi <bluca@debian.org>
Tue, 18 Jul 2023 16:26:02 +0000 (17:26 +0100)
commit3f37a82545d461abdbdea8d6f255d63797e6660c
treef03dd4af07bdc373cd4218e383833612a7df2231
parent1dfa58edd393f0c69251fefccf2aaac187da33ad
core: copy the host's os-release for /run/host/os-release

Currently for portable services we automatically add a bind mount
os-release -> /run/host/os-release. This becomes problematic for the
soft-reboot case, as it's likely that portable services will be configured
to survive it, and thus would forever keep a reference to the old host's
os-release, which would be a problem because it becomes outdated, and also
it stops the old rootfs from being garbage collected.

Create a copy when the manager starts under /run/systemd/propagate instead,
and bind mount that for all services using RootDirectory=/RootImage=, so
that on soft-reboot the content gets updated (without creating a new file,
so the existing bind mounts will see the new content too).

This expands the /run/host/os-release protocol to more services, but I
think that's a nice thing to have too.

Closes https://github.com/systemd/systemd/issues/28023
man/systemd.exec.xml
src/core/execute.c
src/core/main.c
src/core/namespace.c
src/core/namespace.h
src/portable/portable.c
src/test/test-namespace.c
src/test/test-ns.c
test/units/testsuite-50.sh
test/units/testsuite-82.sh