]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: Fix broken host links for container journals (#39727)
authorChris Down <chris@chrisdown.name>
Fri, 21 Nov 2025 15:42:23 +0000 (23:42 +0800)
committerGitHub <noreply@github.com>
Fri, 21 Nov 2025 15:42:23 +0000 (23:42 +0800)
Commit 88252ca changed nspawn to always run from a temporary mount
directory (e.g., /tmp/nspawn-root-XXXXXX). This was a good
simplification for mount logic, but it unintentionally broke the
--link-journal feature.

The setup_journal() helper was subsequently passed this ephemeral path
instead of the persistent machine path (from --directory= or --image=).
This caused the host to create broken symlinks pointing to a temporary
directory that would soon be gone.

Fix this by storing the original path and plumbing it through to
setup_journal().

All other mount-related logic in outer_child() continues to use the
temporary `directory` variable.

Fixes: #39472

Trivial merge