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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1231 - (show annotations) (download)
Mon Jun 13 02:25:31 2005 UTC (9 years, 2 months ago) by vapier
File size: 915 byte(s)
merge cvs Header removal from trunk
1 #!/sbin/runscript
2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 depend() {
6 need localmount
7 }
8
9 start() {
10 [[ -c /dev/urandom ]] || return
11 if [[ -f /var/run/random-seed ]] ; then
12 cat /var/run/random-seed > /dev/urandom
13 fi
14 if ! rm -f /var/run/random-seed &> /dev/null ; then
15 ewarn "Skipping /var/run/random-seed initialization (ro root?)"
16 return 0
17 fi
18 ebegin "Initializing random number generator"
19 umask 077
20 dd if=/dev/urandom of=/var/run/random-seed count=1 &> /dev/null
21 eend $? "Error initializing random number generator"
22 umask 022
23 }
24
25 stop() {
26 [[ -n ${CDBOOT} ]] && return 0
27
28 ebegin "Saving random seed"
29 # Carry a random seed from shut-down to start-up;
30 # see documentation in linux/drivers/char/random.c
31 umask 077
32 dd if=/dev/urandom of=/var/run/random-seed count=1 &> /dev/null
33 eend $? "Failed to save random seed"
34 }
35
36
37 # vim:ts=4

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20