All of lore.kernel.org
 help / color / mirror / Atom feed
* [warrior][PATCH] rng-tools: start rngd early in the boot process again
@ 2019-08-23 16:39 Fabio Berton
  2019-08-23 16:41 ` Fabio Berton
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Berton @ 2019-08-23 16:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: Bedel, Alban

From: "Bedel, Alban" <alban.bedel@aerq.com>

It do make sense to start rngd early in the boot process because
otherwise we would need to track every service that might need entropy
and explicitly configure it to start after rngd.

When used with systemd rngd blocked the shutdown process because it
simply missed the proper unit configuration. As the systemd
documentation explains, when using DefaultDependencies=no one also
have to explicitly configure the unit to properly stop at some point.
This is normaly achieved by having Before=shutdown.target and
Conflicts=shutdown.target set for the unit.

To have rngd started early again we reverte the changes done to
rngd.service in commit edf7606822 (rng-tools: fix rngd blocks system
shutdown). To have it properly stopped on shutdown we also add
Before=shutdown.target and Conflicts=shutdown.target.

Signed-off-by: Alban Bedel <alban.bedel@aerq.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a74e7df33e2c8ab2152e3217c0a5df3f65971713)
---
 meta/recipes-support/rng-tools/rng-tools/rngd.service | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service b/meta/recipes-support/rng-tools/rng-tools/rngd.service
index f0355db14fc..5c8253b5fba 100644
--- a/meta/recipes-support/rng-tools/rng-tools/rngd.service
+++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service
@@ -2,7 +2,8 @@
 Description=Hardware RNG Entropy Gatherer Daemon
 DefaultDependencies=no
 After=systemd-udev-settle.service
-Before=sysinit.target
+Before=sysinit.target shutdown.target
+Conflicts=shutdown.target
 
 [Service]
 ExecStart=@SBINDIR@/rngd -f -r /dev/hwrng
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [warrior][PATCH] rng-tools: start rngd early in the boot process again
  2019-08-23 16:39 [warrior][PATCH] rng-tools: start rngd early in the boot process again Fabio Berton
@ 2019-08-23 16:41 ` Fabio Berton
  2019-09-03  9:33   ` Bedel, Alban
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Berton @ 2019-08-23 16:41 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Bedel, Alban

Without this change, images with systemd hang on shutdown/reboot.

On Fri, Aug 23, 2019 at 1:39 PM Fabio Berton
<fabio.berton@ossystems.com.br> wrote:
>
> From: "Bedel, Alban" <alban.bedel@aerq.com>
>
> It do make sense to start rngd early in the boot process because
> otherwise we would need to track every service that might need entropy
> and explicitly configure it to start after rngd.
>
> When used with systemd rngd blocked the shutdown process because it
> simply missed the proper unit configuration. As the systemd
> documentation explains, when using DefaultDependencies=no one also
> have to explicitly configure the unit to properly stop at some point.
> This is normaly achieved by having Before=shutdown.target and
> Conflicts=shutdown.target set for the unit.
>
> To have rngd started early again we reverte the changes done to
> rngd.service in commit edf7606822 (rng-tools: fix rngd blocks system
> shutdown). To have it properly stopped on shutdown we also add
> Before=shutdown.target and Conflicts=shutdown.target.
>
> Signed-off-by: Alban Bedel <alban.bedel@aerq.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> (cherry picked from commit a74e7df33e2c8ab2152e3217c0a5df3f65971713)
> ---
>  meta/recipes-support/rng-tools/rng-tools/rngd.service | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service b/meta/recipes-support/rng-tools/rng-tools/rngd.service
> index f0355db14fc..5c8253b5fba 100644
> --- a/meta/recipes-support/rng-tools/rng-tools/rngd.service
> +++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service
> @@ -2,7 +2,8 @@
>  Description=Hardware RNG Entropy Gatherer Daemon
>  DefaultDependencies=no
>  After=systemd-udev-settle.service
> -Before=sysinit.target
> +Before=sysinit.target shutdown.target
> +Conflicts=shutdown.target
>
>  [Service]
>  ExecStart=@SBINDIR@/rngd -f -r /dev/hwrng
> --
> 2.20.1
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [warrior][PATCH] rng-tools: start rngd early in the boot process again
  2019-08-23 16:41 ` Fabio Berton
@ 2019-09-03  9:33   ` Bedel, Alban
  0 siblings, 0 replies; 3+ messages in thread
From: Bedel, Alban @ 2019-09-03  9:33 UTC (permalink / raw)
  To: openembedded-core, fabio.berton

On Fri, 2019-08-23 at 13:41 -0300, Fabio Berton wrote:

> Without this change, images with systemd hang on shutdown/reboot.

I already submitted a patch[1] to fix this which is currently under
review. It is the very same patch with a slightly different log
message as the changes from commit edf7606822 (rng-tools: fix rngd
blocks system shutdown) was not applied on warrior.

Alban

[1]: https://patchwork.openembedded.org/patch/163540/

> On Fri, Aug 23, 2019 at 1:39 PM Fabio Berton
> <fabio.berton@ossystems.com.br> wrote:
> > From: "Bedel, Alban" <alban.bedel@aerq.com>
> > 
> > It do make sense to start rngd early in the boot process because
> > otherwise we would need to track every service that might need
> > entropy
> > and explicitly configure it to start after rngd.
> > 
> > When used with systemd rngd blocked the shutdown process because it
> > simply missed the proper unit configuration. As the systemd
> > documentation explains, when using DefaultDependencies=no one also
> > have to explicitly configure the unit to properly stop at some
> > point.
> > This is normaly achieved by having Before=shutdown.target and
> > Conflicts=shutdown.target set for the unit.
> > 
> > To have rngd started early again we reverte the changes done to
> > rngd.service in commit edf7606822 (rng-tools: fix rngd blocks
> > system
> > shutdown). To have it properly stopped on shutdown we also add
> > Before=shutdown.target and Conflicts=shutdown.target.
> > 
> > Signed-off-by: Alban Bedel <alban.bedel@aerq.com>
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > (cherry picked from commit
> > a74e7df33e2c8ab2152e3217c0a5df3f65971713)
> > ---
> >  meta/recipes-support/rng-tools/rng-tools/rngd.service | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service
> > b/meta/recipes-support/rng-tools/rng-tools/rngd.service
> > index f0355db14fc..5c8253b5fba 100644
> > --- a/meta/recipes-support/rng-tools/rng-tools/rngd.service
> > +++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service
> > @@ -2,7 +2,8 @@
> >  Description=Hardware RNG Entropy Gatherer Daemon
> >  DefaultDependencies=no
> >  After=systemd-udev-settle.service
> > -Before=sysinit.target
> > +Before=sysinit.target shutdown.target
> > +Conflicts=shutdown.target
> > 
> >  [Service]
> >  ExecStart=@SBINDIR@/rngd -f -r /dev/hwrng
> > --
> > 2.20.1
> > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-03  9:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 16:39 [warrior][PATCH] rng-tools: start rngd early in the boot process again Fabio Berton
2019-08-23 16:41 ` Fabio Berton
2019-09-03  9:33   ` Bedel, Alban

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.