[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29773: urandom-seed-service should run earlier in the boot process
From: |
Ludovic Courtès |
Subject: |
bug#29773: urandom-seed-service should run earlier in the boot process |
Date: |
Fri, 22 Dec 2017 10:06:46 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hello,
Leo Famulari <address@hidden> skribis:
> On Thu, Dec 21, 2017 at 10:10:29AM +0100, Ludovic Courtès wrote:
>>
>> The attached patch does the trick, AFAICS:
>>
>
>> 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/urandom.")
>> (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’ve 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’.