source: postlfs/config/random.xml@ 3df86b66

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 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 3df86b66 was a75063d4, checked in by Larry Lawrence <larry@…>, 21 years ago

seperating para and screen sections

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

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