[systemd-devel] Service parameters reflection

Lennart Poettering lennart at poettering.net
Tue Jul 21 09:17:40 UTC 2020


On Di, 21.07.20 08:30, Student FourK (student4k at yahoo.com) wrote:

> Hi All,

> Not sure if my question is more suitable for other ML, but...
>
> Is there such a feature in systemd, that allows the process launched
> from "ExecStart=..." to query the parameters of itself without
> resorting to things like popen for "systemctl show <MyServiceName>"
> ? Some client library?

By "parameters" you mean the unit file settings? Or do you mean the
command line parameters of your program?

The unit file settings are exposed as D-Bus properties, i.e. via an
IPC API.

See:
https://www.freedesktop.org/software/systemd/man/org.freedesktop.systemd1.html

This does not go into detail how D-Bus works, but simply explains the
interfaces systemd provides via the bus.

"systemctl show" is just a thin layer over the D-Bus API.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list