source: postlfs/config/random.xml@ 064db32a

10.0 10.1 11.0 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk v1_0 v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 064db32a was 064db32a, checked in by Larry Lawrence <larry@…>, 19 years ago

caught a few more tags

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@876 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 2.4 KB
Line 
1<sect1 id="postlfs-config-random" xreflabel="random">
2<?dbhtml filename="random.html" dir="postlfs"?>
3<title>Random number generation</title>
4
5<para>The Linux kernel supplies a random number generator which is accessed
6through <filename>/dev/random</filename> and
7<filename>/dev/urandom</filename>. Programs that utilize the random and
8urandom devices, such as OpenSSH, will benefit from these instructions.</para>
9
10<para>When a Linux system starts up without much operator interaction, the
11entropy pool, data used to compute a random number, may be in a fairly
12predictable state. This creates the real possibility that the number generated
13at startup may always be the same. In order to counteract this effect,
14you should carry the entropy pool information across your shut-downs and
15start-ups. The following init.d script and links will perform this function
16for you automatically.</para>
17
18<para><screen><userinput>cat &gt; /etc/rc.d/init.d/random &lt;&lt; "EOF"
19</userinput>
20#!/bin/sh
21# Begin $rc_base/init.d/random
22
23# Based on sysklogd script from LFS-3.1 and earlier.
24# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
25# Random script elements by Larry Lawrence
26
27source /etc/sysconfig/rc
28source $rc_functions
29
30case "$1" in
31 start)
32 echo "Initializing kernel random number generator..."
33 if [ -f /var/tmp/random-seed ]; then
34 cat /var/tmp/random-seed >/dev/urandom
35 fi
36 dd if=/dev/urandom of=/var/tmp/random-seed count=1 &amp;>/dev/null
37 evaluate_retval
38 ;;
39
40 stop)
41 echo "Saving random seed..."
42 dd if=/dev/urandom of=/var/tmp/random-seed count=1 &amp;>/dev/null
43 evaluate_retval
44 ;;
45
46 *)
47 echo "Usage: $0 {start|stop}"
48 exit 1
49 ;;
50esac
51
52# End $rc_base/init.d/random
53<userinput>EOF
54chmod 755 /etc/rc.d/init.d/random</userinput></screen></para>
55
56<para>Create the symbolic links to this file in the relevant
57<filename class="directory">rc.d</filename> directories
58with the following commands:
59<screen><userinput>cd /etc/rc.d/init.d &amp;&amp;
60ln -sf ../init.d/random ../rc0.d/K45random &amp;&amp;
61ln -sf ../init.d/random ../rc2.d/S25random &amp;&amp;
62ln -sf ../init.d/random ../rc3.d/S25random &amp;&amp;
63ln -sf ../init.d/random ../rc4.d/S25random &amp;&amp;
64ln -sf ../init.d/random ../rc5.d/S25random &amp;&amp;
65ln -sf ../init.d/random ../rc6.d/K45random</userinput></screen></para>
66
67
68</sect1>
69
Note: See TracBrowser for help on using the repository browser.