system/skeleton: don't use random-seed from a read-only fs
authorBaruch Siach <baruch@tkos.co.il>
Wed, 8 Jul 2015 05:24:12 +0000 (08:24 +0300)
committerPeter Korsgaard <peter@korsgaard.com>
Wed, 8 Jul 2015 21:52:48 +0000 (23:52 +0200)
A random-seed from a read-only filesystem is useless.

Also, drop the check for /etc/random-seed existence; it must exist after a
touch.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
system/skeleton/etc/init.d/S20urandom

index f73cea59edac5ea3b6621cc083f426ad78011cae..36277ba618151c8ff8d0616e5197346dcab040a8 100755 (executable)
 
 case "$1" in
        start|"")
-               if [ "$VERBOSE" != no ]
-               then
-                       echo -n "Initializing random number generator... "
-               fi
-               # Load and then save 512 bytes,
-               # which is the size of the entropy pool
-               if [ -f /etc/random-seed ]
-               then
-                       cat /etc/random-seed >/dev/urandom
-               fi
                # check for read only file system
                if ! touch /etc/random-seed 2>/dev/null
                then
                        echo "read-only file system detected...done"
                        exit
                fi
+               if [ "$VERBOSE" != no ]
+               then
+                       echo -n "Initializing random number generator... "
+               fi
+               # Load and then save 512 bytes,
+               # which is the size of the entropy pool
+               cat /etc/random-seed >/dev/urandom
                rm -f /etc/random-seed
                umask 077
                dd if=/dev/urandom of=/etc/random-seed count=1 \