[systemd-devel] device unit files

Mantas Mikulėnas grawity at gmail.com
Tue Apr 12 05:00:31 UTC 2022


On Mon, Apr 11, 2022 at 5:16 PM Elbek Mamajonov <emm.boxinuse at gmail.com>
wrote:

> How to track down the lifespan of the device unit file, i.e. the
> activating state? I have an embedded system where systemd-analyze plot
> shows that the unit file I am interested in, let’s say
> dev-mmcpartition.device, takes about 2 seconds to be become active. This
> partition (mmcpartition) holds my rootfs. I would like to know what is
> going on during those 2 seconds, what device unit file is doing, how to
> track what it is doing? Thanks in advance.
>

Really the only thing a .device unit "does" is wait for udev to report that
the corresponding actual device is ready. As soon as udev sends out the
uevent with ACTION=add and systemd receives it, the .device unit becomes
active, that's all.

So if that's slow, it might be the kernel not sending the initial 'add'
event *to* udev (AFAIK, systemd-udev-trigger.service is responsible for
triggering fake 'add' events for devices that already exist at boot time,
so check where that service shows up on the graph), or it might be udev
taking a long time to process its .rules for that device, or systemd not
catching up fast enough... Such delays for the mmcblk rootfs seem to be a
frequent question both here on the list as well as on IRC, but I don't
think I remember any specific answers.

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220412/d7ce9123/attachment-0001.htm>


More information about the systemd-devel mailing list