Remove lfs-uefi.txt symlink
[linux_from_scratch_hints.git] / PREVIOUS_FORMAT / fortune.txt
blob7333670d63de2a504bf534c76a105b72805bd486
1 TITLE:                  Fortune Mod 9708
2 LFS VERSION:            Tested on 3.3, should work with any
3 AUTHOR:                 Jack Saunders <jack@jackonline.co.uk>
5 SYNOPSIS:
6         Explains how to install Fortune Mod 9708 and how to make a
7         bootscript to set /etc/motd using fortune.
9 HINT:
10 Download fortune-mod-9708.tar.gz from
11 http://www.ibiblio.org/pub/Linux/games/amusements/fortune/ (or any mirror).
12 Unpack the file with:
13 tar zxvf fortune-mod-9708.tar.gz && cd fortune-mod-9708
15 At this point you have two decisions to make.
16 The first is whether or not you want to install the utils that come with 
17 fortune. These are not required and you probably won't want to use them.
18 Secondly, you need to decide whether or not you want to install the offensive
19 quotes. Offensive counts as: (taken from "Offensive" file)
20         Anything about sex is offensive.  Welcome to America.  *sigh*
21         Insults based on religion or ethnicity are offensive.
22         Generally, any criticism of anybody's religion is offensive.
23         "He really said that?" quotes from politicians are offensive.
24         Political bias is offensive.
25         Limericks are offensive even if they aren't.
26         Tastelessness is offensive (q.v. "The Snack").
27         Misogyny and misandry for the sake of themselves are offensive.
28         Vulgarity is offensive.
29         Violence for the sake of humor is offensive.
30 It is entirely up to you if you install the offensive quotes or not. I choose
31 not to, because I run a multiuser, family system.
33 If you choose not to install the offensive quotes use this to compile the
34 package:
35 make &&
36 make OFFENSIVE=0 install-cookie &&
37 make FORTDIR="/usr/bin" install-fortune &&
38 make install-fman
40 (if you want the utils as well change the above to:
41 make &&
42 make OFFENSIVE=0 install-cookie &&
43 make FORTDIR="/usr/bin" install
46 If you choose to install the offensive quotes use this:
47 make &&
48 make OFFENSIVE=1 install-cookie &&
49 make FORTDIR="/usr/bin" install-fortune &&
50 make install-fman
52 (if you want the utils as well change the above to:
53 make &&
54 make OFFENSIVE=1 install-cookie &&
55 make FORTDIR="/usr/bin" install
58 We install into /usr/bin instead of the default /usr/local/games because
59 1) this directory does not exist in a standard LFS system
60 2) you would have to add /usr/local/games to your PATH
62 I assume /usr/local/games is the FHS compliant place to install fortune, if
63 you want to install into /usr/local/games simply change  FORTDIR="/usr/bin" 
64 to  FORTDIR="/usr/local/games".
66 Test the fortune installation with the command "fortune". You should see a
67 funny (well, hopefully funny ;-)) quote. If you do not check your PATH and 
68 check the install went correctly.
71 /etc/motd is shown every time a user logs in. If you want this to be set by
72 fortune follow the instructions below. If not then you're done!
74 First of all make the bootscript. This is a little hack/edit of the one used
75 in the linux logo hint, thanks to the author of that hint.
77 cat > /etc/rc.d/init.d/motd << "EOF"
78 #!/bin/bash
79 # Begin $rc_base/init.d/motd
81 source /etc/sysconfig/rc
82 source $rc_functions
84 case "$1" in
85         start|stop)
86                 echo "Setting motd (fortune)"
87                 fortune >/etc/motd 2>&1
88                 evaluate_retval
89                 ;;
90         *)
91                 echo "Usage: $0 {start}"
92                 exit 1
93                 ;;
94 esac
96 # End $rc_base/init.d/motd
97 EOF
98 chmod 755 /etc/rc.d/init.d/motd
100 Then make a link in the appropriate run levels:
101 ln /etc/rc.d/init.d/motd /etc/rc.d/rc3.d/S36motd -s &&
102 ln /etc/rc.d/init.d/motd /etc/rc.d/rc4.d/S36motd -s &&
103 ln /etc/rc.d/init.d/motd /etc/rc.d/rc5.d/S36motd -s
105 (I've chosen S36 simply because it came one after the /etc/issue script. If
106 this causes any conflicts or you have a better number for it, please email me
108 We put it in rc5, so that if a user changes to a console, or telnets in the 
109 message will still be seen.
111 Finally reboot the system, log in and you should see a nice message of the
112 day.
114 Feel free to send a questions/comments to me.