unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Leo Famulari <leo@famulari.name>
Cc: 36380@debbugs.gnu.org, Robert Vollmert <rob@vllmrt.net>
Subject: bug#36380: service urandom-seed takes too long on boot
Date: Thu, 11 Jul 2019 23:33:07 +0200	[thread overview]
Message-ID: <87k1contnw.fsf@gnu.org> (raw)
In-Reply-To: <20190711174455.GA30457@jasmine.lan> (Leo Famulari's message of "Thu, 11 Jul 2019 13:44:55 -0400")

Hi Leo,

Leo Famulari <leo@famulari.name> skribis:

> On Fri, Jun 28, 2019 at 01:24:01PM -0400, Leo Famulari wrote:
>> So, I suggest we add a 1 second timeout to this read.
>> 
>> I can work on that next week.
>
> I did try working on this, after reading the code in (guix scripts
> offload (call-with-timeout)).

The ‘start’ method of the ‘urandom-seed’ Shepherd service runs in PID 1,
so we certainly don’t want to fiddle with SIGALRM in that context, which
is what ‘call-with-timeout’ does.

Instead, I think we should use ‘select’ with a timeout:

  (call-with-input-file "/dev/hwrng"
    (lambda (port)
      (match (select (list port) '() '() 3)
        …)))

I think we can then use ‘get-bytevector-n!’, assuming it doesn’t block
if less than COUNT bytes are available (I’m not sure this is the case.)

HTH!

Ludo’.

  reply	other threads:[~2019-07-11 21:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 18:12 bug#36380: service urandom-seed takes too long on boot Robert Vollmert
2019-06-26  9:41 ` Alex Sassmannshausen
2019-06-26 15:47 ` Leo Famulari
2019-06-26 16:02   ` Robert Vollmert
2019-06-27 19:19     ` Leo Famulari
2019-06-27 15:20   ` Ludovic Courtès
2019-06-27 19:03     ` Leo Famulari
2019-06-27 20:00       ` Ludovic Courtès
2019-06-28  6:47       ` Robert Vollmert
2019-06-28 17:24         ` Leo Famulari
2019-07-11 17:44           ` Leo Famulari
2019-07-11 21:33             ` Ludovic Courtès [this message]
2019-07-17 21:04 ` bug#36380: related article (Debian) Robert Vollmert
2020-03-22  8:43 ` bug#36380: service urandom-seed takes too long on boot Brice Waegeneire
2020-03-22 20:19   ` Leo Famulari
2020-12-27 15:00 ` Stefan
2020-12-27 23:09   ` Leo Famulari
2020-12-27 23:28     ` Stefan
2020-12-29  2:51       ` Leo Famulari
2021-02-07 15:23 ` raid5atemyhomework via Bug reports for GNU Guix

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87k1contnw.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=36380@debbugs.gnu.org \
    --cc=leo@famulari.name \
    --cc=rob@vllmrt.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).