GNU bug report logs

#36380 service urandom-seed takes too long on boot

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #43 received at 36380@debbugs.gnu.org (full text, mbox, reply):

Received: (at 36380) by debbugs.gnu.org; 11 Jul 2019 21:33:20 +0000
From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 11 17:33:20 2019
Received: from localhost ([127.0.0.1]:38933 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1hlggp-0002XH-WB
	for submit@debbugs.gnu.org; Thu, 11 Jul 2019 17:33:20 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40387)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@gnu.org>) id 1hlggo-0002X4-A2
 for 36380@debbugs.gnu.org; Thu, 11 Jul 2019 17:33:18 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44278)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@gnu.org>)
 id 1hlggf-0005mT-HY; Thu, 11 Jul 2019 17:33:11 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=51596 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@gnu.org>)
 id 1hlggf-0001ii-3k; Thu, 11 Jul 2019 17:33:09 -0400
From: Ludovic Courtès <ludo@gnu.org>
To: Leo Famulari <leo@famulari.name>
Subject: Re: bug#36380: service urandom-seed takes too long on boot
References: <F88CEF04-9BFA-4886-8A2D-AD84AE278D07@vllmrt.net>
 <20190626154721.GA2999@jasmine.lan> <87zhm3xdfu.fsf@gnu.org>
 <20190627190314.GA7403@jasmine.lan>
 <EA773339-2CC9-486E-99B8-A2E71B34467E@vllmrt.net>
 <20190628172401.GA17073@jasmine.lan>
 <20190711174455.GA30457@jasmine.lan>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 23 Messidor an 227 de la Révolution
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 11 Jul 2019 23:33:07 +0200
In-Reply-To: <20190711174455.GA30457@jasmine.lan> (Leo Famulari's message of
 "Thu, 11 Jul 2019 13:44:55 -0400")
Message-ID: <87k1contnw.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36380
Cc: 36380@debbugs.gnu.org, Robert Vollmert <rob@vllmrt.net>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
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’.




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Sep 7 09:37:51 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.