Hi Kyle, On 2022-02-02 13:38, Kyle Russell wrote:
Is this the correct approach? Even the systemd-udev-settle.service man pages recommends not using its service. Were the kernel modules really not loaded when rngd started? Or is the original problem just a matter of waiting for sufficient entropy?
IIRC, the rngd could not find any random source device node (/dev/hwrng in that case), so the service failed to start.
The patch you are commenting on only adds `Wants` weak dependency to make sure `systemd-udev-settle.service` is pulled in to the job queue, the `After` ordering rule was already there.
So changing this service file to be triggered by a udev event or maybe wrap it in a script, which makes sure the right modules are loaded and device nodes are available, could be an improvement, but it would be out of scope of this patch IMO.
regards, Claudius
On Fri, Sep 17, 2021 at 4:08 AM Claudius Heine <[email protected] <mailto:[email protected]>> wrote:rngd needs to start after `systemd-udev-settle` in order for the kernel modules of the random source hardware to be loaded before it is started. However, since the `rngd.service` does not require or want `systemd-udev-settle.service` it might not be scheduled for start and the `After=systemd-udev-settle.service` there has no effect. Adding `Wants=systemd-udev-settle.service` provides a weak requirement to it, so that the `rngd` is started after it, if possible. Signed-off-by: Claudius Heine <[email protected] <mailto:[email protected]>> --- Hi, this is a fix, which should probably be backported to the maintained releases. regards, Claudius meta/recipes-support/rng-tools/rng-tools/rngd.service | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service b/meta/recipes-support/rng-tools/rng-tools/rngd.service index 0559b97991..568686e80e 100644 --- a/meta/recipes-support/rng-tools/rng-tools/rngd.service +++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service @@ -3,6 +3,7 @@ Description=Hardware RNG Entropy Gatherer Daemon DefaultDependencies=no After=systemd-udev-settle.service Before=sysinit.target shutdown.target +Wants=systemd-udev-settle.service Conflicts=shutdown.target [Service]-- 2.33.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#161195): https://lists.openembedded.org/g/openembedded-core/message/161195 Mute This Topic: https://lists.openembedded.org/mt/85671578/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
