Ensure haveged is running before ssh service is invoked
authorMichael Prokop <mika@grml.org>
Thu, 13 Dec 2018 13:58:00 +0000 (14:58 +0100)
committerMichael Prokop <mika@grml.org>
Thu, 13 Dec 2018 14:01:47 +0000 (15:01 +0100)
The random number generator might take quite some while until we reach
state `random: crng init done`. If ssh service is started *before* crng
is done then ssh service startup blocks system boot until enough entropy
is available.

By starting haveged (Linux entropy source using the HAVEGE algorithm)
before ssh service we avoid this.

Since haveged is in our GRMLBASE software selection we can assume that
it's present by default.

FTR, it might be useful to start haveged all the time, but before
going that route let's try whether having it for SSH service is enough.

autoconfig.functions

index 7ea1f8b..cea100a 100755 (executable)
@@ -924,6 +924,7 @@ if checkbootparam 'ssh' ; then
    fi
 
    einfo "Starting secure shell server in background for root and user $localuser"
+   service_wrapper haveged start >>$DEBUG 2>>$DEBUG
    service_wrapper rmnologin start >>$DEBUG 2>>$DEBUG
    service_wrapper ssh start background >>$DEBUG 2>>$DEBUG
    eend $?