source: postlfs/config/random.xml@ fe4403e5

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb v1_0 v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since fe4403e5 was f45b1953, checked in by Mark Hymers <markh@…>, 22 years ago

Initial revision

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

  • Property mode set to 100644
File size: 2.3 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 &>/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 &>/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 rc.d directories
57with the following commands:
58<screen><userinput>cd /etc/rc.d/init.d &amp;&amp;
59ln -sf ../init.d/random ../rc0.d/K45random &amp;&amp;
60ln -sf ../init.d/random ../rc2.d/S25random &amp;&amp;
61ln -sf ../init.d/random ../rc3.d/S25random &amp;&amp;
62ln -sf ../init.d/random ../rc4.d/S25random &amp;&amp;
63ln -sf ../init.d/random ../rc5.d/S25random &amp;&amp;
64ln -sf ../init.d/random ../rc6.d/K45random</userinput></screen></para>
65
66
67</sect1>
68
Note: See TracBrowser for help on using the repository browser.