]> git.ipfire.org Git - thirdparty/systemd.git/commit
Add ExtraFileDescriptor property to StartTransientUnit dbus API 34556/head
authorRyan Wilson <ryantimwilson@meta.com>
Mon, 30 Sep 2024 16:58:34 +0000 (09:58 -0700)
committerRyan Wilson <ryantimwilson@meta.com>
Mon, 7 Oct 2024 16:01:48 +0000 (09:01 -0700)
commit3543456f84ec2e83e07b6c9bf2b3a1c5d30241d8
tree536be385f8411801ee9f1c15a13ce87d156191ea
parentf88813b71a6fcd92bf04c6adcb54e7cd7551f7e2
Add ExtraFileDescriptor property to StartTransientUnit dbus API

This adds the ExtraFileDescriptor property to StartTransient dbus API
with format "a(hs)" - array of (file descriptor, name) pairs. The FD
will be passed to the unit via sd_notify like Socket and OpenFile.

systemctl show also shows ExtraFileDescriptorName for these transient
units. We only show the name passed to dbus as the FD numbers will
change once passed over the unix socket and are duplicated, so its
confusing to display the numbers.

We do not add this functionality for systemd-run or general systemd
service units as it is not useful for general systemd services.
Arguably, it could be useful for systemd-run in bash scripts but we
prefer to be cautious and not expose the API yet.

Fixes: #34396
man/org.freedesktop.systemd1.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/service.c
src/core/service.h
src/systemctl/systemctl-show.c
test/units/TEST-23-UNIT-FILE.ExtraFileDescriptors.sh [new file with mode: 0755]