From 8a0d0eb26aa41410c523ddaaf9278b483855c54a Mon Sep 17 00:00:00 2001 From: Alex Gronenwoud Date: Mon, 25 Aug 2003 21:42:04 +0000 Subject: [PATCH] neatened text of chapter 6 util-linux and shadow git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2678 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/shadowpwd-inst.xml | 87 +++++++++++++++++++----------------- chapter06/utillinux-inst.xml | 22 +++++---- 2 files changed, 60 insertions(+), 49 deletions(-) diff --git a/chapter06/shadowpwd-inst.xml b/chapter06/shadowpwd-inst.xml index 57a4266c4..c840033dc 100644 --- a/chapter06/shadowpwd-inst.xml +++ b/chapter06/shadowpwd-inst.xml @@ -9,11 +9,13 @@ regarding passwords, such as how to enable the more secure MD5 passwords and how to get the most out of this Shadow package. The Shadow hint can be found at . -Programs like login, shutdown, uptime, and others want to read -from and to the /var/run/utmp, /var/log/btmp and /var/log/wtmp. These -files contain information about who is currently logged in. They also -contain information about when the conmputer was last booted and -shutdown and a record of bas login attempts. +The login, getty and +init programs (and some others) maintain a number +of logfiles to record who are and who were logged in to the system. These +programs, however, don't create these logfiles when they don't exist, so if +you want this logging to occur you will have to create the files yourself. +To let the Shadow package (that is installed next) detect these files in their +proper place, create them now, with their proper permissions: Create these files with their proper permissions by running the following commands: @@ -21,77 +23,80 @@ following commands: touch /var/run/utmp /var/log/{btmp,lastlog,wtmp} chmod 644 /var/run/utmp /var/log/{btmp,lastlog,wtmp} -Shadow hard-codes the path to the passwd binary within itself, but -it does it the wrong way. If no passwd binary is present before -installing Shadow, it (wrongly) assumes that it will be at /bin/passwd, -but then installs its own in /usr/bin/passwd. This will lead to strange -errors about not finding /bin/passwd. To fix workaround this bug in -Shadow, we'll create a dummy passwd file so that it gets hardcoded in -the right place: +The /var/run/utmp file lists the users that are +currently logged in, the /var/log/wtmp file who +were logged in and when. +The /var/log/lastlog file shows for each user when he +or she last logged in, and the /var/log/btmp lists the +bad login attempts. + +Shadow hard-wires the path to the passwd binary +within the binary itself, but does this the wrong way. If before installing +Shadow no passwd binary is present , the package wrongly +assumes it is going to be located at /bin/passwd, +but then installs it in /usr/bin/passwd. This will lead +to weird errors about not finding /bin/passwd. To work +around this bug, create a dummy passwd file, +so that it gets hard-wired properly: touch /usr/bin/passwd -Prepare Shadow to be compiled: +Now prepare Shadow for compilation: -./configure --prefix=/usr --libdir=/usr/lib \ -    --enable-shared +./configure --prefix=/usr --libdir=/usr/lib --enable-shared -Continue with compiling the package: +Compile the package: make -Install the package: +And install it: make install -Shadow uses two files to configure authentication settings for -the system. Install those config files: +Shadow uses two files to configure authentication settings for the +system. Install these two config files: cp etc/{limits,login.access} /etc -/var/spool/mail is the -old location of the user mailboxes. The location that is used nowadays -is /var/mail. Issue the following command to modify the mailbox -location: +In the old days /var/spool/mail +was the location for the user mailboxes, but nowadays /var/mail is used. Change the default mailbox +location in the relevant configuration file while copying it to its +destination: sed 's%/var/spool/mail%/var/mail%' \     etc/login.defs.linux > /etc/login.defs -According to the manpage of vipw, -a vigr symlink should exist. Because the -shadow installation procedure doesn't create this symlink, it -must be created manually: +According to the man page of vipw, a +vigr program should exist too. Since the installation +procedure doesn't create this program, create a symlink manually: ln -s vipw /usr/sbin/vigr -The vipw link is currently pointing -to a non-existing file. Since this file isn't needed here, remove -it: +As the /bin/vipw symlink is redundant (and even +pointing to a non-existent file), remove it: rm /bin/vipw -Move the sg program to the -/usr/bin directory: +Now move the sg program to its proper place: mv /bin/sg /usr/bin -Move Shadow's dynamic libraries to a more appropriate location: +And move Shadow's dynamic libraries to a more appropriate location: mv /usr/lib/lib{shadow,misc}.so.0* /lib -The libraries have been moved, but some packages expect to -find them in them in the -/usr/lib directory. To account -for this, create the following symlinks: +As some packages expect to find the just-moved libraries in +/usr/lib, create the following symlinks: ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so -Sh-utils and Shadow Password Suite each install a unique -groups program. If you wish, you may remove the -groups program installed by the Shadow Password -Suite: +Coreutils has already installed a groups program +in /usr/bin. If you wish, you can remove the one +installed by Shadow: rm /bin/groups + diff --git a/chapter06/utillinux-inst.xml b/chapter06/utillinux-inst.xml index d4065822f..2d801ad59 100644 --- a/chapter06/utillinux-inst.xml +++ b/chapter06/utillinux-inst.xml @@ -3,9 +3,10 @@ FHS compliance notes -The FHS recommends that we use /var/lib/hwclock, instead of the -usual /etc, as the location of the adjtime file. To make hwclock -FHS-compliant, run the following: +The FHS recommends that we use /var/lib/hwclock, +instead of the usual /etc, as the location for the +adjtime file. To make the hwclock +program FHS-compliant, run the following: cp hwclock/hwclock.c{,.backup} sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \ @@ -17,18 +18,23 @@ mkdir -p /var/lib/hwclock Installation of Util-linux -Prepare Util-linux to be compiled: +Prepare Util-linux for compilation: ./configure -Continue with compiling the package: +Compile the package: make HAVE_SLN=yes -The HAVE_SLN option prevents this package, -which was already was installed by Glibc, from being built again. +The meaning of the make parameter: + +HAVE_SLN=yes: This prevents the +sln program (a statically linked +ln, already installed by Glibc) from being built +again. + -Finish installing the package: +And install the package: make HAVE_SLN=yes install