From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 11 17:33:20 2019 Received: (at 36380) by debbugs.gnu.org; 11 Jul 2019 21:33:20 +0000 Received: from localhost ([127.0.0.1]:38933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) 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 ) 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 ) 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 ) id 1hlggf-0001ii-3k; Thu, 11 Jul 2019 17:33:09 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Leo Famulari Subject: Re: bug#36380: service urandom-seed takes too long on boot References: <20190626154721.GA2999@jasmine.lan> <87zhm3xdfu.fsf@gnu.org> <20190627190314.GA7403@jasmine.lan> <20190628172401.GA17073@jasmine.lan> <20190711174455.GA30457@jasmine.lan> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 23 Messidor an 227 de la =?utf-8?Q?R=C3=A9volution?= 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Leo, Leo Famulari 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. >>=20 >> 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 =E2=80=98start=E2=80=99 method of the =E2=80=98urandom-seed=E2=80=99 Sh= epherd service runs in PID=C2=A01, so we certainly don=E2=80=99t want to fiddle with SIGALRM in that context, = which is what =E2=80=98call-with-timeout=E2=80=99 does. Instead, I think we should use =E2=80=98select=E2=80=99 with a timeout: (call-with-input-file "/dev/hwrng" (lambda (port) (match (select (list port) '() '() 3) =E2=80=A6))) I think we can then use =E2=80=98get-bytevector-n!=E2=80=99, assuming it do= esn=E2=80=99t block if less than COUNT bytes are available (I=E2=80=99m not sure this is the ca= se.) HTH! Ludo=E2=80=99.