/[baselayout]/trunk/init.d/urandom
Gentoo

Contents of /trunk/init.d/urandom

Parent Directory Parent Directory | Revision Log Revision Log


Revision 266 - (show annotations) (download)
Mon Nov 18 13:07:02 2002 UTC (17 years ago) by azarah
File size: 804 byte(s)
change license

1 #!/sbin/runscript
2 # Copyright 1999-2002 Gentoo Technologies, Inc.
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header$
5
6
7 depend() {
8 need localmount
9 }
10
11 start() {
12 [ -c /dev/urandom ] || return
13 ebegin "Initializing random number generator"
14 if [ -f /var/run/random-seed ]
15 then
16 cat /var/run/random-seed >/dev/urandom
17 fi
18 rm -f /var/run/random-seed &>/dev/null
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 ebegin "Saving random seed"
27 # Carry a random seed from shut-down to start-up;
28 # see documentation in linux/drivers/char/random.c
29 umask 077
30 dd if=/dev/urandom of=/var/run/random-seed count=1 &>/dev/null
31 eend $? "Failed to save random seed."
32 }
33
34
35 # 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