From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#29773: urandom-seed-service should run earlier in the boot process Date: Fri, 22 Dec 2017 10:06:46 +0100 Message-ID: <87po779lnd.fsf@gnu.org> References: <20171219191348.GA19177@jasmine.lan> <87tvwlzop3.fsf@gnu.org> <20171220230751.GA18857@jasmine.lan> <87ind0a1kq.fsf@gnu.org> <20171221190914.GA11808@jasmine.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSJII-0007aj-CN for bug-guix@gnu.org; Fri, 22 Dec 2017 04:07:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSJIE-0001XA-6v for bug-guix@gnu.org; Fri, 22 Dec 2017 04:07:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:38170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eSJIE-0001X4-2v for bug-guix@gnu.org; Fri, 22 Dec 2017 04:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eSJID-0003Ua-Sm for bug-guix@gnu.org; Fri, 22 Dec 2017 04:07:01 -0500 Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Message-ID: In-Reply-To: <20171221190914.GA11808@jasmine.lan> (Leo Famulari's message of "Thu, 21 Dec 2017 14:09:14 -0500") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Leo Famulari Cc: 29773-done@debbugs.gnu.org Hello, Leo Famulari skribis: > On Thu, Dec 21, 2017 at 10:10:29AM +0100, Ludovic Court=C3=A8s wrote: >>=20 >> The attached patch does the trick, AFAICS: >>=20 > >> diff --git a/gnu/services/base.scm b/gnu/services/base.scm >> index acc5c33f5..7fc8f6aa7 100644 >> --- a/gnu/services/base.scm >> +++ b/gnu/services/base.scm >> @@ -529,7 +529,10 @@ in KNOWN-MOUNT-POINTS when it is stopped." >> (list (shepherd-service >> (documentation "Preserve entropy across reboots for /dev/urand= om.") >> (provision '(urandom-seed)) >> - (requirement '(file-systems)) >> + >> + ;; Depend on udev so that /dev/hwrng is available. >> + (requirement '(file-systems udev)) >> + >> (start #~(lambda _ >> ;; On boot, write random seed into /dev/urandom. >> (when (file-exists? #$%random-seed-file) > > Yes, it seems to work for me. Great, I=E2=80=99ve pushed the whole series. > I'm unsure if the stop action of urandom-seed-service is being executed > on shutdown. > > I added some print statements and sleep delays to the stop action but > the system halts faster than I expected and I don't see any writes to > /var/lib/random-seed. /var/lib/random-seed is definitely being updated on shutdown on my system, as can be seen from its mtime. Thanks, Ludo=E2=80=99.