<p dir="ltr">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.</p>
<p dir="ltr">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=...`</p>
<p dir="ltr">Could you elaborate on why you find this checking necessary in the first place? Do your udev rules run some weird stuff?</p>
<p dir="ltr">If you're working with your own internal services, there might be other ways of checking this.</p>
<br><div class="gmail_quote"><div dir="ltr">On Thu, Apr 13, 2017, 11:24 Martin Wilck <<a href="mailto:mwilck@suse.com">mwilck@suse.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
is there a way to test whether a certain service is enabled (or is<br>
going to be enabled) that would work even very early in the boot<br>
process (in our case from udev rules called in the "udev trigger" phase<br>
both in initrd and after switching root)?<br>
<br>
I tried calling "systemctl is-enabled" but it obviously depends on some<br>
services (dbus, I guess) being functional, and didn't provide reliable<br>
results during early boot for us.<br>
<br>
We finally resorted to scanning *.wants directories by ourselves, but<br>
that's of course sub-optimal (poor mans partial implementation of<br>
systemd's service enablement logic).<br>
<br>
Regards<br>
Martin<br>
<br>
--<br>
Dr. Martin Wilck <<a href="mailto:mwilck@suse.com" target="_blank">mwilck@suse.com</a>>, Tel. +49 (0)911 74053 2107<br>
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton<br>
HRB 21284 (AG Nürnberg)<br>
<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><p dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>><br>
Sent from my phone</p>
</div>