mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
core: Add RootDirectoryFileDescriptor=
RootDirectory= but via a open_tree() file descriptor. This allows setting up the execution environment for a service by the client in a mount namespace and then starting a transient unit in that execution environment using the new property. We also add --root-directory= and --same-root-dir= to systemd-run to have it run services within the given root directory. As systemd-run might be invoked from a different mount namespace than what systemd is running in, systemd-run opens the given path with open_tree() and then sends it to systemd using the new RootDirectoryFileDescriptor= property.
This commit is contained in:
@@ -890,6 +890,9 @@ systemctl stop test-root-ephemeral
|
||||
timeout 10 bash -c 'until test -z "$(ls -A /var/lib/systemd/ephemeral-trees)"; do sleep .5; done'
|
||||
test ! -f /tmp/img/abc
|
||||
|
||||
# Test RootDirectoryFileDescriptor=
|
||||
systemd-run --wait --pipe --root-directory=/tmp/img -- grep -q 'MARKER=1' /usr/lib/os-release
|
||||
|
||||
systemd-dissect --mtree /tmp/img >/dev/null
|
||||
systemd-dissect --list /tmp/img >/dev/null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user