]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: Add RootDirectoryFileDescriptor= 39480/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 28 Oct 2025 22:47:26 +0000 (23:47 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 31 Oct 2025 12:09:51 +0000 (13:09 +0100)
commit9e26ced9809bcac96a34dc89825cdcee4e17a078
tree65288b5c398426d03fdd339cc13158d546897bd0
parent456ee3c5f95806110df52be33c13281893a19ea4
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.
15 files changed:
man/systemd-run.xml
src/core/dbus-service.c
src/core/exec-invoke.c
src/core/execute-serialize.c
src/core/execute.c
src/core/execute.h
src/core/fuzz-execute-serialize.c
src/core/namespace.c
src/core/namespace.h
src/core/service.c
src/core/service.h
src/run/run.c
src/test/test-namespace.c
src/test/test-ns.c
test/units/TEST-50-DISSECT.dissect.sh