All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyle Russell <bkylerussell@gmail.com>
To: Claudius Heine <ch@denx.de>
Cc: OE-core <openembedded-core@lists.openembedded.org>,
	Marek Vasut <marex@denx.de>,
	Alex Kiernan <alex.kiernan@gmail.com>,
	Alexander Kanavin <alex.kanavin@gmail.com>,
	Alban Bedel <alban.bedel@aerq.com>,
	Wes Lindauer <wesley.lindauer@gmail.com>
Subject: Re: [OE-core] [PATCH] rng-tools: add systemd-udev-settle wants to service
Date: Wed, 2 Feb 2022 11:26:09 -0500	[thread overview]
Message-ID: <CAFrQVPNiHZ8MEv0uaHUpi4J=Erefa1GLzGYh_af19X6A-gxg4g@mail.gmail.com> (raw)
In-Reply-To: <fa9e9247-c4f0-8896-bf54-95a03eff2105@denx.de>

[-- Attachment #1: Type: text/plain, Size: 4206 bytes --]

Thanks, Claudius.

On Wed, Feb 2, 2022 at 8:08 AM Claudius Heine <ch@denx.de> wrote:

> 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.
>

If /dev/hwrng didn't exist, this feels like the original problem was a
misconfigured
kernel or module that wasn't being loaded properly.


> 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.
>

Correct.  Just because an `After` exists does not mean the service gets
pulled into
the job queue, so prior to this change no other service was causing the
deprecated
systemd-udev-settle.service to be run during boot.  But now, every device
including
openssh (which has a default PACKAGECONFIG option for rng-tools) now depends
on this deprecated service, which may cause unexpected boot delays.


> 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.
>

I'm more curious whether this change should be reverted from upstream.  It
seems
like a drop-in file could have been applied to your distro instead of
adding a dependency
on a deprecated service for all openssh users.

Kyle


> >
> > On Fri, Sep 17, 2021 at 4:08 AM Claudius Heine <ch@denx.de
> > <mailto:ch@denx.de>> 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 <ch@denx.de <mailto:ch@denx.de>>
> >     ---
> >
> >     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 (#156129):
> >     https://lists.openembedded.org/g/openembedded-core/message/156129
> >     <https://lists.openembedded.org/g/openembedded-core/message/156129>
> >     Mute This Topic: https://lists.openembedded.org/mt/85671578/4454381
> >     <https://lists.openembedded.org/mt/85671578/4454381>
> >     Group Owner: openembedded-core+owner@lists.openembedded.org
> >     <mailto:openembedded-core%2Bowner@lists.openembedded.org>
> >     Unsubscribe:
> >     https://lists.openembedded.org/g/openembedded-core/unsub
> >     <https://lists.openembedded.org/g/openembedded-core/unsub>
> >     [bkylerussell@gmail.com <mailto:bkylerussell@gmail.com>]
> >     -=-=-=-=-=-=-=-=-=-=-=-
> >
>

[-- Attachment #2: Type: text/html, Size: 6884 bytes --]

  reply	other threads:[~2022-02-02 16:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  8:08 [PATCH] rng-tools: add systemd-udev-settle wants to service Claudius Heine
2022-02-02 12:38 ` [OE-core] " Kyle Russell
2022-02-02 13:08   ` Claudius Heine
2022-02-02 16:26     ` Kyle Russell [this message]
2022-02-03  8:35       ` Claudius Heine
2022-02-03 14:12         ` Kyle Russell
2022-07-21 15:17           ` Drew Moseley
2022-07-21 15:29             ` Khem Raj
2022-07-22 20:42               ` Drew Moseley
2022-07-23  0:30                 ` [OE-core] " Khem Raj
2022-07-23  7:03               ` Claudius Heine
2022-07-26 13:17                 ` [OE-core][PATCH] rng-tools: Replace obsolete "wants systemd-udev-settle" drew.moseley
2022-08-01 18:44                   ` Drew Moseley
2022-08-02  7:24                     ` Claudius Heine
2022-08-02  7:47                       ` Khem Raj
2022-08-04 15:09                         ` [OE-core][PATCH v2] " drew.moseley
2022-08-12 12:59                           ` Dragos-Marian Panait
2022-08-12 15:20                             ` Drew Moseley
2022-08-15 18:25                               ` [OE-core][PATCH] rng-tools: Change "Requires" to "WantedBy" for dev-hwrng.device drew.moseley
2022-08-15 18:29                                 ` Drew Moseley
2022-08-15 18:47                                   ` Khem Raj
2022-08-18 17:12                                     ` Alexander Kanavin
2022-08-19  9:36                                 ` Claudius Heine
2022-08-19 12:50                                   ` Dragos-Marian Panait
2022-08-19 14:34                                     ` Drew Moseley
2022-08-19 15:07                                       ` Dragos-Marian Panait
2022-08-19 15:13                                         ` Drew Moseley
2022-08-19 15:21                                           ` Alexander Kanavin
2022-08-19 16:24                                             ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFrQVPNiHZ8MEv0uaHUpi4J=Erefa1GLzGYh_af19X6A-gxg4g@mail.gmail.com' \
    --to=bkylerussell@gmail.com \
    --cc=alban.bedel@aerq.com \
    --cc=alex.kanavin@gmail.com \
    --cc=alex.kiernan@gmail.com \
    --cc=ch@denx.de \
    --cc=marex@denx.de \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=wesley.lindauer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.