Discussion:
reliable way to check if udev is ready to serve requests
(too old to reply)
Michael Biebl
2018-10-09 20:24:48 UTC
Permalink
Hi,

is there a reliable way to check from a shell script that udevd is
running and able to serve request?
Say you want to run "udevadm trigger" but only if udevd is actually
able to process that request.

There is a udev_ctrl_send_ping() function, which looks like it could
be perhaps used for those. Unfortunately this is not exposed via
"udevadm control"

Regards,
Michael
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
Lennart Poettering
2018-10-11 06:54:00 UTC
Permalink
Post by Michael Biebl
Hi,
is there a reliable way to check from a shell script that udevd is
running and able to serve request?
Say you want to run "udevadm trigger" but only if udevd is actually
able to process that request.
There is a udev_ctrl_send_ping() function, which looks like it could
be perhaps used for those. Unfortunately this is not exposed via
"udevadm control"
systemctl is-running systemd-udevd-kernel.socket

Lennart
--
Lennart Poettering, Red Hat
Michael Biebl
2018-10-12 01:57:15 UTC
Permalink
Am Do., 11. Okt. 2018 um 08:54 Uhr schrieb Lennart Poettering
Post by Lennart Poettering
Post by Michael Biebl
Hi,
is there a reliable way to check from a shell script that udevd is
running and able to serve request?
Say you want to run "udevadm trigger" but only if udevd is actually
able to process that request.
There is a udev_ctrl_send_ping() function, which looks like it could
be perhaps used for those. Unfortunately this is not exposed via
"udevadm control"
systemctl is-running systemd-udevd-kernel.socket
I forgot to add, that systemd-udevd is not necessarily started by
systemd in this particular case. So I can't use systemctl...
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
Lennart Poettering
2018-10-12 08:42:33 UTC
Permalink
Post by Michael Biebl
Post by Lennart Poettering
Post by Michael Biebl
is there a reliable way to check from a shell script that udevd is
running and able to serve request?
Say you want to run "udevadm trigger" but only if udevd is actually
able to process that request.
There is a udev_ctrl_send_ping() function, which looks like it could
be perhaps used for those. Unfortunately this is not exposed via
"udevadm control"
systemctl is-running systemd-udevd-kernel.socket
I forgot to add, that systemd-udevd is not necessarily started by
systemd in this particular case. So I can't use systemctl...
Well, that depends on the init system you want to use, so consider
asking their community for help, how they allow you to check whether a
socket is started up correctly (or a service, in case socket
activation is not supported).

For legacy systems udevd still supports forking things into the
background, hence if you know when the udevd starter process (i.e. the
"parent") exits then you should know when the service is up.

Either way, this is really out of scope for systemd, it's a question
you can only answer in the context of the init system used, as on
socket activation capable systems udev will be able to process events
that happen even before the daemon itself is up while on legacy
systems the daemon must be up first.

Lennart
--
Lennart Poettering, Red Hat
Continue reading on narkive:
Loading...