/[baselayout]/branches/rc-scripts-1_6/init.d/urandom
Gentoo

Diff of /branches/rc-scripts-1_6/init.d/urandom

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 935 Revision 936
8} 8}
9 9
10start() { 10start() {
11 [[ -c /dev/urandom ]] || return 11 [[ -c /dev/urandom ]] || return
12 if [[ -f /var/run/random-seed ]] ; then 12 if [[ -f /var/run/random-seed ]] ; then
13 cat /var/run/random-seed > /dev/urandom 13 cat /var/run/random-seed > /dev/urandom
14 fi 14 fi
15 if ! rm -f /var/run/random-seed &> /dev/null ; then 15 if ! rm -f /var/run/random-seed &> /dev/null ; then
16 ewarn "Skipping /var/run/random-seed initialization (ro root?)" 16 ewarn "Skipping /var/run/random-seed initialization (ro root?)"
17 return 0 17 return 0
18 fi 18 fi
19 ebegin "Initializing random number generator" 19 ebegin "Initializing random number generator"
20 umask 077 20 umask 077
21 dd if=/dev/urandom of=/var/run/random-seed count=1 &>/dev/null 21 dd if=/dev/urandom of=/var/run/random-seed count=1 &> /dev/null
22 eend $? "Error initializing random number generator" 22 eend $? "Error initializing random number generator"
23 umask 022 23 umask 022
24} 24}
25 25
26stop() { 26stop() {
28 28
29 ebegin "Saving random seed" 29 ebegin "Saving random seed"
30 # Carry a random seed from shut-down to start-up; 30 # Carry a random seed from shut-down to start-up;
31 # see documentation in linux/drivers/char/random.c 31 # see documentation in linux/drivers/char/random.c
32 umask 077 32 umask 077
33 dd if=/dev/urandom of=/var/run/random-seed count=1 &>/dev/null 33 dd if=/dev/urandom of=/var/run/random-seed count=1 &> /dev/null
34 eend $? "Failed to save random seed" 34 eend $? "Failed to save random seed"
35} 35}
36 36
37 37
38# vim:ts=4 38# vim:ts=4

Legend:
Removed from v.935  
changed lines
  Added in v.936

  ViewVC Help
Powered by ViewVC 1.1.20