[systemd-devel] Early testing for service enablement

Lennart Poettering lennart at poettering.net
Thu Apr 13 09:45:30 UTC 2017


On Thu, 13.04.17 08:49, Mantas Mikulėnas (grawity at gmail.com) wrote:

> IIRC, enable/disable/is-enabled are implemented entirely via direct
> filesystem access. Other than that, systemctl uses a private socket when
> running as root – it talks DBus but doesn't require dbus-daemon.

Correct, enable/disable/is-enabled can operate without PID 1, but they
usually don't unless the tool detects it is being run in a chroot
environment.

And yes, systemctl can communicate with PID 1 through a private
communication socket that exists as long as PID 1 exists. dbus-daemon
is not needed, except when your client is unprivileged.

In recent systemd versions you can even force systemctl to always do
"sytemctl enable/disable/is-enabled" on the client side by setting the
env var SYSTEMCTL_INSTALL_CLIENT_SIDE=1 for it. But this is usually
not necessary nor a good idea, as PID 1 won't notify clients about
changes then, since it doesn't know about them.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list