/[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 936 - (show annotations) (download)
Thu Feb 10 01:09:42 2005 UTC (9 years, 6 months ago) by vapier
File size: 926 byte(s)
urandom

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