diff options
Diffstat (limited to 'misc/slackbook/html/system-configuration.html')
-rw-r--r-- | misc/slackbook/html/system-configuration.html | 589 |
1 files changed, 589 insertions, 0 deletions
diff --git a/misc/slackbook/html/system-configuration.html b/misc/slackbook/html/system-configuration.html new file mode 100644 index 00000000..2c88375a --- /dev/null +++ b/misc/slackbook/html/system-configuration.html @@ -0,0 +1,589 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta name="generator" content="HTML Tidy, see www.w3.org" /> +<title>System Configuration</title> +<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /> +<link rel="HOME" title="Slackware Linux Essentials" href="index.html" /> +<link rel="PREVIOUS" title="The setup Program" href="installation-setup.html" /> +<link rel="NEXT" title="Selecting a Kernel" href="system-configuration-kernel.html" /> +<link rel="STYLESHEET" type="text/css" href="docbook.css" /> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +</head> +<body class="CHAPTER" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084" +alink="#0000FF"> +<div class="NAVHEADER"> +<table summary="Header navigation table" width="100%" border="0" cellpadding="0" +cellspacing="0"> +<tr> +<th colspan="3" align="center">Slackware Linux Essentials</th> +</tr> + +<tr> +<td width="10%" align="left" valign="bottom"><a href="installation-setup.html" +accesskey="P">Prev</a></td> +<td width="80%" align="center" valign="bottom"></td> +<td width="10%" align="right" valign="bottom"><a href="system-configuration-kernel.html" +accesskey="N">Next</a></td> +</tr> +</table> + +<hr align="LEFT" width="100%" /> +</div> + +<div class="CHAPTER"> +<h1><a id="SYSTEM-CONFIGURATION" name="SYSTEM-CONFIGURATION"></a>Chapter 4 System +Configuration</h1> + +<div class="TOC"> +<dl> +<dt><b>Table of Contents</b></dt> + +<dt>4.1 <a href="system-configuration.html#SYSTEM-CONFIGURATION-OVERVIEW">System +Overview</a></dt> + +<dt>4.2 <a href="system-configuration-kernel.html">Selecting a Kernel</a></dt> +</dl> +</div> + +<p>Before you can configure the more advanced parts of your system, it's a good idea to +learn how the system is organized and what commands can be used to search for files and +programs. It's also good to know if you need to compile a custom kernel and what the +steps for doing that are. This chapter will familiarize you with system organization and +configuration files. Then, you can move on to configuring the more advanced parts of the +system.</p> + +<div class="SECT1"> +<h1 class="SECT1"><a id="SYSTEM-CONFIGURATION-OVERVIEW" +name="SYSTEM-CONFIGURATION-OVERVIEW">4.1 System Overview</a></h1> + +<p>It's important to understand how a Linux system is put together before diving into the +various configuration aspects. A Linux system is significantly different from a DOS, +Windows, or Macintosh system (with the exception of the Unix-based Mac OS X), but these +sections will help you get acquainted with the layout so that you can easily configure +your system to meet your needs.</p> + +<div class="SECT2"> +<h2 class="SECT2"><a id="SYSTEM-CONFIGURATION-LAYOUT" +name="SYSTEM-CONFIGURATION-LAYOUT">4.1.1 File System Layout</a></h2> + +<p>The first noticeable difference between Slackware Linux and a DOS or Windows system is +the filesystem. For starters, we do not use drive letters to denote different partitions. +Under Linux, there is one main directory. You can relate this to the <tt +class="DEVICENAME">C:</tt> drive under DOS. Each partition on your system is mounted to a +directory on the main directory. It's kind of like an ever-expanding hard disk.</p> + +<p>We call the main directory the root directory, and it's denoted with a single slash +(<tt class="FILENAME">/</tt>). This concept may seem strange, but it actually makes life +easy for you when you want to add more space. For example, let's say you run out of space +on the drive that has <tt class="FILENAME">/home</tt> on it. Most people install +Slackware and make one big root drive. Well, since a partition can be mounted to any +directory, you can simply go to the store and pick up a new hard drive and mount it to +<tt class="FILENAME">/home</tt>. You've now grafted on some more space to your system. +And all without having to move many things around.</p> + +<p>Below, you will find descriptions of the major top level directories under +Slackware.</p> + +<div class="VARIABLELIST"> +<dl> +<dt><tt class="FILENAME">bin</tt></dt> + +<dd> +<p>Essential user programs are stored here. These represent the bare minimum set of +programs required for a user to use the system. Things like the shell and the filesystem +commands (<tt class="COMMAND">ls</tt>, <tt class="COMMAND">cp</tt>, and so on) are stored +here. The <tt class="FILENAME">/bin</tt> directory usually doesn't receive modification +after installation. If it does, it's usually in the form of package upgrades that we +provide.</p> +</dd> + +<dt><tt class="FILENAME">boot</tt></dt> + +<dd> +<p>Files that are used by the Linux Loader (LILO). This directory also receives little +modification after an installation. The kernel is stored here as of Slackware 8.1. In +earlier releases of Slackware, the kernel was simply stored under <tt +class="FILENAME">/</tt> , but common practice is to put the kernel and related files here +to facilitate dual-booting.</p> +</dd> + +<dt><tt class="FILENAME">dev</tt></dt> + +<dd> +<p>Everything in Linux is treated as a file, even hardware devices like serial ports, +hard disks, and scanners. In order to access these devices, a special file called a +device node has to be present. All device nodes are stored in the <tt +class="FILENAME">/dev</tt> directory. You will find this to be true across many Unix-like +operating systems.</p> +</dd> + +<dt><tt class="FILENAME">etc</tt></dt> + +<dd> +<p>This directory holds system configuration files. Everything from the X Window +configuration file, the user database, to the system startup scripts. The system +administrator will become quite familiar with this directory over time.</p> +</dd> + +<dt><tt class="FILENAME">home</tt></dt> + +<dd> +<p>Linux is a multiuser operating system. Each user on the system is given an account and +a unique directory for personal files. This directory is called the user's home +directory. The <tt class="FILENAME">/home</tt> directory is provided as the default +location for user home directories.</p> +</dd> + +<dt><tt class="FILENAME">lib</tt></dt> + +<dd> +<p>System libraries that are required for basic operation are stored here. The C library, +the dynamic loader, the ncurses library, and kernel modules are among the things stored +here.</p> +</dd> + +<dt><tt class="FILENAME">mnt</tt></dt> + +<dd> +<p>This directory contains temporary mount points for working on hard disks or removable +drives. Here you'll find mount points for your CD-ROM and floppy drives.</p> +</dd> + +<dt><tt class="FILENAME">opt</tt></dt> + +<dd> +<p>Optional software packages. The idea behind <tt class="FILENAME">/opt</tt> is that +each software package installs to <tt class="FILENAME">/opt/<var +class="REPLACEABLE">software-package</var></tt>, which makes it easy to remove later. +Slackware distributes some things in <tt class="FILENAME">/opt</tt> (such as KDE in <tt +class="FILENAME">/opt/kde</tt>), but you are free to add anything you want to <tt +class="FILENAME">/opt</tt>.</p> +</dd> + +<dt><tt class="FILENAME">proc</tt></dt> + +<dd> +<p>This is a unique directory. It's not really part of the filesystem, but a virtual +filesystem that provides access to kernel information. Various pieces of information that +the kernel wants you to know are conveyed to you through files in the <tt +class="FILENAME">/proc</tt> directory. You can also send information to the kernel +through some of these files. Try doing <tt class="COMMAND">cat /proc/cpuinfo</tt>.</p> +</dd> + +<dt><tt class="FILENAME">root</tt></dt> + +<dd> +<p>The system administrator is known as <tt class="USERNAME">root</tt> on the system. <tt +class="USERNAME">root</tt>'s home directory is kept in <tt class="FILENAME">/root</tt> +instead of <tt class="FILENAME">/home/root</tt>. The reason is simple. What if <tt +class="FILENAME">/home</tt> was a different partition from <tt class="FILENAME">/</tt> +and it could not be mounted? <tt class="USERNAME">root</tt> would naturally want to log +in and repair the problem. If his home directory was on the damaged filesystem, it would +make it difficult for him to log in.</p> +</dd> + +<dt><tt class="FILENAME">sbin</tt></dt> + +<dd> +<p>Essential programs that are run by <tt class="USERNAME">root</tt> and during the +system bootup process are kept here. Normal users will not run programs in this +directory.</p> +</dd> + +<dt><tt class="FILENAME">tmp</tt></dt> + +<dd> +<p>The temporary storage location. All users have read and write access to this +directory.</p> +</dd> + +<dt><tt class="FILENAME">usr</tt></dt> + +<dd> +<p>This is the big directory on a Linux system. Everything else pretty much goes here, +programs, documentation, the kernel source code, and the X Window system. This is the +directory to which you will most likely be installing programs.</p> +</dd> + +<dt><tt class="FILENAME">var</tt></dt> + +<dd> +<p>System log files, cache data, and program lock files are stored here. This is the +directory for frequently-changing data.</p> +</dd> +</dl> +</div> + +<p>You should now have a good feel for which directories contain what on the filesystem. +More detailed information about the filesystem layout is available in the hier(7) man +page. The next section will help you find specific files easily, so you don't have to do +it by hand.</p> +</div> + +<div class="SECT2"> +<h2 class="SECT2"><a id="SYSTEM-CONFIGURATION-FINDING" +name="SYSTEM-CONFIGURATION-FINDING">4.1.2 Finding Files</a></h2> + +<p>You now know what each major directory holds, but it still doesn't really help you +find things. I mean, you could go looking through directories, but there are quicker +ways. There are four main file search commands available in Slackware.</p> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1329" name="AEN1329">4.1.2.1 <tt +class="COMMAND">which</tt></a></h3> + +<p>The first is the <tt class="COMMAND">which</tt>(1) command. <tt +class="COMMAND">which</tt> is usually used to locate a program quickly. It just searches +your <tt class="ENVAR">PATH</tt> and returns the first instance it finds and the +directory path to it. Take this example:</p> + +<table border="0" bgcolor="#E0E0E0" width="100%"> +<tr> +<td> +<pre class="SCREEN"> +<samp class="PROMPT">%</samp> <kbd class="USERINPUT">which bash</kbd> +/bin/bash +</pre> +</td> +</tr> +</table> + +<p>From that you see that <tt class="COMMAND">bash</tt> is in the <tt +class="FILENAME">/bin</tt> directory. This is a very limited command for searching, since +it only searches your <tt class="ENVAR">PATH</tt>.</p> +</div> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1347" name="AEN1347">4.1.2.2 <tt +class="COMMAND">whereis</tt></a></h3> + +<p>The <tt class="COMMAND">whereis</tt>(1) command works similar to <tt +class="COMMAND">which</tt>, but can also search for man pages and source files. A <tt +class="COMMAND">whereis</tt> search for <tt class="COMMAND">bash</tt> should return +this:</p> + +<table border="0" bgcolor="#E0E0E0" width="100%"> +<tr> +<td> +<pre class="SCREEN"> +<samp class="PROMPT">%</samp> <kbd class="USERINPUT">whereis bash</kbd> +bash: /bin/bash /usr/bin/bash /usr/man/man1/bash.1.gz +</pre> +</td> +</tr> +</table> + +<p>This command not only told us where the actual program is located, but also where the +online documentation is stored. Still, this command is limited. What if you wanted to +search for a specific configuration file? You can't use <tt class="COMMAND">which</tt> or +<tt class="COMMAND">whereis</tt> for that.</p> +</div> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1363" name="AEN1363">4.1.2.3 <tt +class="COMMAND">find</tt></a></h3> + +<p>The <tt class="COMMAND">find</tt>(1) command allows the user to search the filesystem +with a rich collection of search predicates. Users may specify a search with filename +wildcards, ranges of modification or creation times, or other advanced properties. For +example, to search for the default <tt class="FILENAME">xinitrc</tt> file on the system, +the following command could be used.</p> + +<table border="0" bgcolor="#E0E0E0" width="100%"> +<tr> +<td> +<pre class="SCREEN"> +<samp class="PROMPT">%</samp> <kbd class="USERINPUT">find / -name xinitrc</kbd> +/var/X11R6/lib/xinit/xinitrc +</pre> +</td> +</tr> +</table> + +<p><tt class="COMMAND">find</tt> will take a while to run, since it has to traverse the +entire root directory tree. And if this command is run as a normal user, there will be +permission denied error messages for directories that only <tt class="USERNAME">root</tt> +can see. But <tt class="COMMAND">find</tt> found our file, so that's good. If only it +could be a bit faster...</p> +</div> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1378" name="AEN1378">4.1.2.4 <tt +class="COMMAND">slocate</tt></a></h3> + +<p>The <tt class="COMMAND">slocate</tt>(1) command searches the entire filesystem, just +like the find command can do, but it searches a database instead of the actual +filesystem. The database is set to automatically update every morning, so you have a +somewhat fresh listing of files on your system. You can manually run <tt +class="COMMAND">updatedb</tt>(1) to update the slocate database (before running <tt +class="COMMAND">updatedb</tt> by hand, you must first <tt class="COMMAND">su</tt> to the +<tt class="USERNAME">root</tt> user). Here's an example of <tt +class="COMMAND">slocate</tt> in action:</p> + +<table border="0" bgcolor="#E0E0E0" width="100%"> +<tr> +<td> +<pre class="SCREEN"> +<samp class="PROMPT">%</samp> <kbd +class="USERINPUT">slocate xinitrc</kbd> # we don't have to go to the root +/var/X11R6/lib/xinit/xinitrc +/var/X11R6/lib/xinit/xinitrc.fvwm2 +/var/X11R6/lib/xinit/xinitrc.openwin +/var/X11R6/lib/xinit/xinitrc.twm +</pre> +</td> +</tr> +</table> + +<p>We got more than what we were looking for, and quickly too. With these commands, you +should be able to find whatever you're looking for on your Linux system.</p> +</div> +</div> + +<div class="SECT2"> +<h2 class="SECT2"><a id="SYSTEM-CONFIGURATION-RCD" name="SYSTEM-CONFIGURATION-RCD">4.1.3 +The <tt class="FILENAME">/etc/rc.d</tt> Directory</a></h2> + +<p>The system initialization files are stored in the <tt class="FILENAME">/etc/rc.d</tt> +directory. Slackware uses the BSD-style layout for its initialization files as opposed to +System V init scripts, which tend to make configuration changes much more difficult +without using a program specifically designed for that purpose. In BSD-init scripts, each +runlevel is given a single rc file. In System V, each runlevel is given its own +directory, each containing numerous init scripts. This provides an organized structure +that is easy to maintain.</p> + +<p>There are several categories of initialization files. These are system startup, +runlevels, network initialization, and System V compatibility. As per tradition, we'll +lump everything else into another category.</p> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1406" name="AEN1406">4.1.3.1 System Startup</a></h3> + +<p>The first program to run under Slackware besides the Linux kernel is <tt +class="COMMAND">init</tt>(8). This program reads the <tt +class="FILENAME">/etc/inittab</tt>(5) file to see how to run the system. It runs the <tt +class="FILENAME">/etc/rc.d/rc.S</tt> script to prepare the system before going into your +desired runlevel. The <tt class="FILENAME">rc.S</tt> file enables your virtual memory, +mounts your filesystems, cleans up certain log directories, initializes Plug and Play +devices, loads kernel modules, configures PCMCIA devices, sets up serial ports, and runs +System V init scripts (if found). Obviously <tt class="FILENAME">rc.S</tt> has a lot on +its plate, but here are some scripts in <tt class="FILENAME">/etc/rc.d</tt> that <tt +class="FILENAME">rc.S</tt> will call on to complete its work:</p> + +<div class="VARIABLELIST"> +<dl> +<dt><tt class="FILENAME">rc.S</tt></dt> + +<dd> +<p>This is the actual system initialization script.</p> +</dd> + +<dt><tt class="FILENAME">rc.modules</tt></dt> + +<dd> +<p>Loads kernel modules. Things like your network card, PPP support, and other things are +loaded here. If this script finds <tt class="FILENAME">rc.netdevice</tt>, it will run +that as well.</p> +</dd> + +<dt><tt class="FILENAME">rc.pcmcia</tt></dt> + +<dd> +<p>Probes for and configures any PCMCIA devices that you might have on your system. This +is most useful for laptop users, who probably have a PCMCIA modem or network card.</p> +</dd> + +<dt><tt class="FILENAME">rc.serial</tt></dt> + +<dd> +<p>Configures your serial ports by running the appropriate <tt +class="COMMAND">setserial</tt> commands.</p> +</dd> + +<dt><tt class="FILENAME">rc.sysvinit</tt></dt> + +<dd> +<p>Looks for System V init scripts for the desired runlevel and runs them. This is +discussed in more detail below.</p> +</dd> +</dl> +</div> +</div> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1454" name="AEN1454">4.1.3.2 Runlevel Initialization +Scripts</a></h3> + +<p>After system initialization is complete, <tt class="COMMAND">init</tt> moves on to +runlevel initialization. A runlevel describes the state that your machine will be running +in. Sound redundant? Well, the runlevel tells <tt class="COMMAND">init</tt> if you will +be accepting multiuser logins or just a single user, whether or not you want network +services, and if you will be using the X Window System or <tt +class="COMMAND">agetty</tt>(8) to handle logins. The files below define the different +runlevels in Slackware Linux.</p> + +<div class="VARIABLELIST"> +<dl> +<dt><tt class="FILENAME">rc.0</tt></dt> + +<dd> +<p>Halt the system (runlevel 0). By default, this is symlinked to <tt +class="FILENAME">rc.6</tt>.</p> +</dd> + +<dt><tt class="FILENAME">rc.4</tt></dt> + +<dd> +<p>Multiuser startup (runlevel 4), but in X11 with KDM, GDM, or XDM as the login +manager.</p> +</dd> + +<dt><tt class="FILENAME">rc.6</tt></dt> + +<dd> +<p>Reboot the system (runlevel 6).</p> +</dd> + +<dt><tt class="FILENAME">rc.K</tt></dt> + +<dd> +<p>Startup in single user mode (runlevel 1).</p> +</dd> + +<dt><tt class="FILENAME">rc.M</tt></dt> + +<dd> +<p>Multiuser mode (runlevels 2 and 3), but with the standard text-based login. This is +the default runlevel in Slackware.</p> +</dd> +</dl> +</div> +</div> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1493" name="AEN1493">4.1.3.3 Network Initialization</a></h3> + +<p>Runlevels 2, 3, and 4 will start up the network services. The following files are +responsible for the network initialization:</p> + +<div class="VARIABLELIST"> +<dl> +<dt><tt class="FILENAME">rc.inet1</tt></dt> + +<dd> +<p>Created by <tt class="COMMAND">netconfig</tt>, this file is responsible for +configuring the actual network interface.</p> +</dd> + +<dt><tt class="FILENAME">rc.inet2</tt></dt> + +<dd> +<p>Runs after <tt class="FILENAME">rc.inet1</tt> and starts up basic network +services.</p> +</dd> + +<dt><tt class="FILENAME">rc.atalk</tt></dt> + +<dd> +<p>Starts up AppleTalk services.</p> +</dd> + +<dt><tt class="FILENAME">rc.httpd</tt></dt> + +<dd> +<p>Starts up the Apache web server. Like a few other rc scripts, this one can also be +used to stop and restart a service. <tt class="FILENAME">rc.httpd</tt> takes arguments of +stop, start, or restart. </p> +</dd> + +<dt><tt class="FILENAME">rc.news</tt></dt> + +<dd> +<p>Starts up the news server.</p> +</dd> +</dl> +</div> +</div> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1534" name="AEN1534">4.1.3.4 System V Compatibility</a></h3> + +<p>System V init compatibility was introduced in Slackware 7.0. Many other Linux +distributions make use of this style instead of the BSD style. Basically each runlevel is +given a subdirectory for init scripts, whereas BSD style gives one init script to each +runlevel.</p> + +<p>The <tt class="FILENAME">rc.sysvinit</tt> script will search for any System V init +scripts you have in <tt class="FILENAME">/etc/rc.d</tt> and run them, if the runlevel is +appropriate. This is useful for certain commercial software packages that install System +V init scripts</p> +</div> + +<div class="SECT3"> +<h3 class="SECT3"><a id="AEN1546" name="AEN1546">4.1.3.5 Other Files</a></h3> + +<p>The scripts described below are the other system initialization scripts. They are +typically run from one of the major scripts above, so all you need to do is edit the +contents.</p> + +<div class="VARIABLELIST"> +<dl> +<dt><tt class="FILENAME">rc.gpm</tt></dt> + +<dd> +<p>Starts up general purpose mouse services. Allows you to copy and paste at the Linux +console. Occasionally, gpm will cause problems with the mouse when it is used under X +windows. If you experience problems with the mouse under X, try taking away the +executable permission from this file and stopping the gpm server.</p> +</dd> + +<dt><tt class="FILENAME">rc.font</tt></dt> + +<dd> +<p>Loads the custom screen font for the console.</p> +</dd> + +<dt><tt class="FILENAME">rc.local</tt></dt> + +<dd> +<p>Contains any specific startup commands for your system. This is empty after a fresh +install, as it is reserved for local administrators. This script is run after all other +initialization has taken place.</p> +</dd> +</dl> +</div> + +<p>To enable a script, all you need to do is add the execute permissions to it with the +<tt class="COMMAND">chmod</tt> command. To disable a script, remove the execute +permissions from it. For more information about <tt class="COMMAND">chmod</tt>, see <a +href="filesystem-structure-permissions.html">Section 9.2</a>.</p> +</div> +</div> +</div> +</div> + +<div class="NAVFOOTER"> +<hr align="LEFT" width="100%" /> +<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" +cellspacing="0"> +<tr> +<td width="33%" align="left" valign="top"><a href="installation-setup.html" +accesskey="P">Prev</a></td> +<td width="34%" align="center" valign="top"><a href="index.html" +accesskey="H">Home</a></td> +<td width="33%" align="right" valign="top"><a href="system-configuration-kernel.html" +accesskey="N">Next</a></td> +</tr> + +<tr> +<td width="33%" align="left" valign="top">The <tt class="COMMAND">setup</tt> Program</td> +<td width="34%" align="center" valign="top"> </td> +<td width="33%" align="right" valign="top">Selecting a Kernel</td> +</tr> +</table> +</div> +</body> +</html> + |