diff --git libexec/rc/rc.d/random libexec/rc/rc.d/random index c34f0d1f86b4..aa2d227f61ef 100755 --- libexec/rc/rc.d/random +++ libexec/rc/rc.d/random @@ -54,10 +54,12 @@ random_start() echo -n 'Feeding entropy: ' + checkyesno root_rw_mount || mount -uw / if [ ! -w /dev/random ] ; then warn "/dev/random is not writeable" return 1 fi + checkyesno root_rw_mount || mount -ur / # Reseed /dev/random with previously stored entropy. case ${entropy_dir:=/var/db/entropy} in @@ -74,8 +76,10 @@ random_start() [Nn][Oo]) ;; *) + checkyesno root_rw_mount || mount -uw / feed_dev_random "${entropy_file}" /var/db/entropy-file save_dev_random "${entropy_file}" + checkyesno root_rw_mount || mount -ur / ;; esac @@ -83,7 +87,9 @@ random_start() [Nn][Oo]) ;; *) + checkyesno root_rw_mount || mount -uw / save_dev_random "${entropy_boot_file}" + checkyesno root_rw_mount || mount -ur / ;; esac @@ -100,6 +106,7 @@ random_stop() ;; *) echo -n 'Writing entropy file: ' + checkyesno root_rw_mount || mount -uw / rm -f ${entropy_file} 2> /dev/null oumask=`umask` umask 077 @@ -123,6 +130,7 @@ random_stop() ;; esac umask ${oumask} + checkyesno root_rw_mount || mount -ur / ;; esac case ${entropy_boot_file:=/boot/entropy} in @@ -130,6 +138,7 @@ random_stop() ;; *) echo -n 'Writing early boot entropy file: ' + checkyesno root_rw_mount || mount -uw / rm -f ${entropy_boot_file} 2> /dev/null oumask=`umask` umask 077 @@ -146,6 +155,7 @@ random_stop() ;; esac umask ${oumask} + checkyesno root_rw_mount || mount -ur / ;; esac }