[systemd-devel] Early testing for service enablement

Mantas Mikulėnas grawity at gmail.com
Thu Apr 13 08:49:20 UTC 2017


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.

A bigger problem is that initramfs can't know much about the main system
due to having a separate /etc, unless maybe you run `systemctl --root=...`

Could you elaborate on why you find this checking necessary in the first
place? Do your udev rules run some weird stuff?

If you're working with your own internal services, there might be other
ways of checking this.

On Thu, Apr 13, 2017, 11:24 Martin Wilck <mwilck at suse.com> wrote:

> Hi all,
>
> is there a way to test whether a certain service is enabled (or is
> going to be enabled) that would work even very early in the boot
> process (in our case from udev rules called in the "udev trigger" phase
> both in initrd and after switching root)?
>
> I tried calling "systemctl is-enabled" but it obviously depends on some
> services (dbus, I guess) being functional, and didn't provide reliable
> results during early boot for us.
>
> We finally resorted to scanning *.wants directories by ourselves, but
> that's of course sub-optimal (poor mans partial implementation of
> systemd's service enablement logic).
>
> Regards
> Martin
>
> --
> Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-- 

Mantas Mikulėnas <grawity at gmail.com>
Sent from my phone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170413/227b139a/attachment.html>


More information about the systemd-devel mailing list