LINUX NEWBIE ADMINISTRATOR GUIDE
ver. 0.120 2001-03-16 by Stan and Peter Klimas
The latest version of this guide is available at http://sunsite.dk/linux-newbie.
Copyright (c) <1999,2000,2001> by Peter and Stan Klimas. Your feedback, comments, corrections, and improvements are appreciated. Send them to linux_nag@canada.com This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0, 8 or later http://opencontent.org/openpub/ with the modification noted in lnag_licence.html.

Quick navigation:

Part 4.4: Linux Newbie Administrator FAQ - Basic Configurations

Contents:
4.5 Basic Configurations
   4.4.1 How to setup my soundcard?
   4.4.2 How do I setup my printer?
   4.4.3 Word Perfect 8 does not have a driver for my printer
   4.4.4 Configuration files
   4.4.5 Device files
   4.4.6 Some daemons

4.4  Printer and soundcard

4.4.1 How to setup my soundcard?

Try to run  (as root)
setup
The third button from the top ("sndconfig") sets up the sound card. Unless you have a very fancy sound card, this will work for you. At the end of the setup, Linus says how he pronounces "Linux".  ("sndconfig" can be also run directly from the command line--type sndconfig -- useful under Mandrake, which does not have "setup".)
You may want to try your soundcard and cdrom using a command line cdplayer. Put a music CD to your CDROM and type:
cdplay
If this does not work, maybe you don't have /dev/cdrom?  Check if you can mount a data CD as a root (look here) and create the device /dev/cdrom by linking it to the appropriate drive (most likely /dev/hdb), for example:
ln -s /dev/hdb /dev/cdrom
If cdplay works for root, but does not work for a regular user, maybe you need to give (as root) everybody the permissions to read and write to the the file /dev/cdrom :
chmod 666 /dev/cdrom
(The directory /dev  is where all your devices appear as files.)
Now, that you got hooked on cdplay, you can play third song, try:
cdplay play 3
You can also use the command cdp for rudimentary command line interface to cdplay, but perhaps you prefer the interfaces available from under X-windows (e.g., from KDE "K" menu, choose: Multimedia-"CD Player").
To stop the music either press the button on you CDROM or issue one of these commands:
eject
cdplay stop

4.4.2 How do I setup my printer?

From the GUI login screen, logon as root. If X-windows is not running, start an X-windows session by typing (as root):
startx
Read here if your X-windows is not set up properly yet.
Start an X-terminal (the "two-computer" button on your K-bar) and type in it:
printtool
This program does a complete printer setup, you just have to fill up the information about your type of printer and where it is hooked up.
Specifying the proper printer port is the most important part. If you don't know which one is yours try:
on RedHat 5.2: lp1 (this is the first parallel port on RH5.2 ) or lp2 (this is the second parallel port on RH5.2) or lp3 (this is the third parallel port on RH5.2); on RedHat 6.0 (or later):  lp0 (this is the first parallel port on RH6.x) or lp1 (this is the second parallel port on RH6.x) or lp2 (this is the third parallel port on RH6.x).  After upgrading from RH5.2 to 6.0, the printing stopped working because the name of the parallel ports changed. I had to re-run the printool and adjust the port. The numbering of ports changed to bring it in line with numbering of other devices, which always starts from 0.
Try printing an ASCII test-page straight to the port. Only when this works set up the bells and whistles.
If you are setting up a remote printer, make sure that your machine has the permission to use the remote printer. The permissions are set in the file /etc/hosts.lpd (more secure) or /etc/hosts.equiv (less secure)  on the machine to which the printer is attached. These files simply list the names of the remote computers that can use a local printer, one computer name per line. Mine looks like this:
hacker
mars
The file /etc/hosts.lpd did not exist on my system, so I created it.
For quick information about the printers on your machine, you may want to view the file /etc/printcap :
cd /etc/
cat printcap
Here is the meaning of some codes that I see in my /etc/printcap:
:Field separator (separates the entries in the file).
\(at the end of line) Continuation on the next line.
lpName of the printer. "lp" is the name of the default printer on your machine. Subsequent printers are often, by default, given the the names lp0 or lp1, ... (or whatever you like) but this should not be confused with the name of the devices (parallel ports) to which they are connected.
sd=/var/spool/lpd/lpMy spool directory (sd).
mx#0Maximum size of print jobs (mx) in blocks. "0" means no limit.
shI want headers to be suppressed (sh). Header is the page with your name that prints before your printing job (waste of paper if you print at home).
rm=marsName of the remote machine (rm), which on my system is called "mars (my printer is connected to a different computer).
rp=lp 

or

lp=/dev/lp0

Name of the remote printer (rp), which is the name of the printer on the remote machine ("lp" on "mars" on my home network)
or 

the name of the device on the local machine.  "/dev/lp0" is the first parallel port on RH6.x (it used to be /dev/lp1 on RH5.2, the numbering of parallel ports changed).

if=/var/spool/lpd/lp/filterInput filter (if). Your printing job will be formatted by this "filter" before it is sent to the printer.
sfSuppress the form feed (sf)  that is normally sent when printing is completed (use it if your printer keeps printing an empty page at the end of each jobs).
The printer is controlled using the command lpc (as root).  Type "?" to see the options. This program is notorious for its peculiarities, so don't get discouraged easily. The printer queue can be viewed with lpq and cleaned up with lprm, both of which work for a user (not only root). You can print from the command line using the command lpr.  Under KDE, you can control the printer queue from the program available under the "K-button"-"Utilities"-"Printer Queue".

4.4.3 Word Perfect 8 does not have a driver for my printer

If you installed your printer in KDE using the printtool and it had a driver which works fine, set up Word Perfect to print using the "passthru postscript" driver.

4.4 4 Where are the setup and configuration files?

System-wide settings settings are stored in the /etc directory. User-specific settings are stored in the user home directory /home/user_login_name.

Here is a listing of some system-wide configuration files that you I use most often:

SHELL DEFAULTS
/etc/bashrc - system-wide default functions and aliases for the bash shell
/etc/profile - system-wide defaults for bash shell, including system-wide environment variables.

ADMINISTRATIVE SETTINGS
/etc/passwd - contains passwords and other information concerning users who are registered to use the system. It can be modified by root directly, but it is preferable to use a configuration utility such as passwd to make the changes. A corrupt /etc/passwd file can easily render a Linux box unusable.
/etc/group - similar to /etc/passwd but for groups
/etc/crontab - setup for "cron", which runs commands periodically (hourly, daily, weekly, monthly, etc.).
/etc/inittab - runs different programs and processes on star.
/etc/issue - message that accompanies login prompt. This is often overwitten by the rc.local script.
/etc/issue.net - same as above, but used when login is attempted over the network.
/etc/motd - "message of the day" file, displayed after a user logs in.

NETWORK CONFIGURATION
/etc/hosts - contains a list of host names and absolute IP addresses.
/etc/hosts.allow - hosts allowed to access Internet services
/etc/hosts.deny - hosts forbidden to access Internet services
/etc/resolv.conf - setups for a list of domain name servers used by the local machine
/etc/inetd.conf - configures the inetd daemon to tell it what TCP/IP services your machine should run.
/etc/exports - specifies hosts to which file systems can be exported using NFS (network file system). man exports contains information on how to set up this file for remote users.

HARDWARE CONFIGURATION
/etc/conf.modules - setup for the linux kernel modules. Modules are like "device drivers" under MS Windows or DOS.
/etc/fstab - contains information on partitions and filesystems used by system to mount different partitions and devices on the directory tree.
/etc/mtab - shows currently mounted devices and partitions and their status.
/etc/lilo.conf - configuration file for lilo boot loader.
/etc/printcap -  setup for printers.
/etc/termcap - ASCII database defining the capabilities and characteristics of different consoles, terminals, and printers. You typically don't want to change those.
/etc/X11/XF86Config - X configuration file.

4.4.5 What are all the device files?

Devices appear as files in the directory /dev. They can be read, or written to, if you have the permission to do so. The listing of the file reveals some important details about the device, for example:

ls -l /dev/ttyS3

on my system produces the following output:

crwxr-xr-x    1 root     tty        4,  67 Mar 13 22:59 ttyS3

The initial "c" indicates a character device. "b" would mean "block device", "p"=FIFO device, "u"=unbuffered character device, "d"=directory, "l"=symbolic link. The numbers "4, 67" mean that the device major number is 4 and the minor number is 67.

Here is a list of some common devices:

/dev/modem - the serial modem. In the typical case, a symbolic link to /dev/ttyS1, /dev/ttyS2, /dev/ttyS3 or /dev/ttyS0, depending to which serial port your modem is connected.
/dev/mouse - mouse. In the typical case, a symbolic link to /dev/ttyS0 or similar (see above), depending to which serial port your mouse is connected.
/dev/lp0  - printer on the first parallel port
/dev/lp1  - printer on the second parallel port
/dev/fd0 - first floppy disk drive
/dev/fd0H1440 - driver for the first floppy drive in high density mode. Generally, this is invoked when formatting a floppy drive for a particular density. Slackware also comes drivers that allow for formatting a 3.5" diskette with up to 1.7MB of space. Red Hat and Mandrake do not contain these device driver files by default.
/dev/fd1 - second floppy disk drive.
/dev/hda - first IDE hard drive .
/dev/hdb - second IDE hard drive.
/dev/hdc - third IDE drive. On many machines, the IDE cdrom drive is attached here.
/dev/cdrom - typically, a symbolic link to the appropriate hard drive, e.g. /dev/hdc.
/dev/tty1  -  the first text console
/dev/dsp - digital audio, i.e., the sound card. "dps" stands for "digital signal processing".
/dev/sndstat - do cat /dev/sndstat to learn about the status of your sound devices.
/dev/null - used when you want to send output into oblivion.
/dev/random - used to read pseudo-random numbers.

For more info try:
less /usr/src/linux/Documentation/devices.txt
man MAKEDEV

Some Linux daemons

Daemons are a "resident"programs that periodically wake up, check your system and may perform certain functions. Your Linux system is likely "factory" set to run quite a number of daemons. Most of them can be (dis)selected by running the program ntsysv (RedHat) as root and checking the appropriate box. The short description of each daemon is available from netsysv by pressing <F1>.  If the daemon you need is not listed in ntsysv, you need to insert your RedHat/Mandrake installation CD and install the appropriate package. The alternative to ntsysv may be tksysv (type as root, in X terminal), which is perhaps more flexible, but way more complicated (it lets you set up the list of daemons to run in each runlevel). Another, simplier and even more powerful+flexible+difficult-to-use tool is /sbin/chkconfig.

Here is a short list of popular daemons with a short description:

anacron - checks `cron' jobs that were left out due to down time and executes them. Useful if you have cron jobs scheduled but don't run your machine all the time--anacron will detect that during bootup.
amd - automount daemon (automatically mounts removable media).
apmd - Advanced Power Management BIOS daemon. For use on machines, especially laptops, that support apm.
arpwatch - keeps watch for ethernet/ip address pairings.
atd - runs jobs queued by the "at"  command.
autofs - control the operation of automount daemons (competition to amd).
bootparamd - server process that provides information to diskless clients necessary for booting.
crond - automatic task scheduler. Manages the execution of tasks that are executed at regular but infrequent intervals, such as rotating log files, cleaning up /tmp directories, etc.
cupsd - the Common UNIX Printing System (CUPS) daemon. CUPS is an advanced printer spooling system which allows setting of printer options and automatic availability of a printer configured on one server in the whole network. The default printing system of Linux Mandrake.
dhcpd - implements the Dynamic Host Configuration Protocol (DHCP) and the Internet Bootstrap Protocol (BOOTP).
gated - routing daemon that handles multiple routing protocols and replaces routed and egpup.
gpm - useful mouse server for applications running on the Linux text console.
httpd - daemon for the Apache webserver.
inetd - listens for service requests on network connections, particularly dial-in services. This daemon can automatically load and unload other daemons (ftpd, telnetd, etc.), thereby economizing on system resources.
isdn4linux - for users of ISDN cards.
kerneld - automatically loads and unloads kernel modules.
kudzu - detects and configures new or changed hardware during boot.
keytable - loads selected keyboard map.
linuxconf - the linuxconf configuration tool. The automated part of is run if you want linuxconf to perform various tasks at boot-time to maintain the system configuration.
lpd - printing daemon.
mcserv - server program for the Midnight Commander networking file system. It provides access to the host file system to clients running the Midnight file system (currently, only the Midnight Commander file manager). If the program is run as root the program will try to get a reserved port otherwise it will use 9876 as the port. If the system has a portmapper running, then the port will be registered with the portmapper and thus clients will automatically connect to the right port. If the system does not have a portmapper, then a port should be manually specified with the -p option (see below).
named - the Internet Domain Name Server (DNS) daemon.
netfs - network filesystem mounter. Used for mounting nfs, smb and ncp shares on boot.
network -activates all network interfaces at boot time by calling scripts in /etc/sysconfig/network-scripts
nfsd - used for exporting nfs shares when requested by remote systems
nfslock - starts and stops nfs file locking service
numlock - locks numlock key at init runlevel change.
pcmcia - generic services for pcmcia cards in laptops.
portmap - needed for Remote Procedure Calls
postfix - mail transport agent which is a replacement for sendmail. Now the default on desktop installations of Mandrake (RedHat uses sendmail instead).
random - saves and restores the "entropy" pool for higher quality random number generation.
routed - manages routing tables
rstatd - kernel statistics server
rusersd, rwalld - identification of users and "wall" messaging services for remote users.
rwhod - server which maintains the database used by the rwho(1) and ruptime(1) programs. Its operation is predicated on the ability to broadcast messages on a network.
sendmail - mail transfer agent. This is the agent that comes with Red Hat.
smbd -  the SAMBA (or smb) daemon, a network connectivity services to MS Windows computers on your network (hard drive sharing, printers, etc).
squid - An http proxy with caching. Proxies relay requests from clients to the outside world, and return the results. You would use this particular proxy if you wanted to use your linux computer as a gateway to the Internet for other computer on your network. Another (and probably safer at home) way to do it, is to set up masquarading.
syslogd - manages system activity logging.
smtpd - Simple Mail Transfer Protocol, designed for the exchange of electronic mail messages. Several daemons that support SMTP are available, including sendmail, smtpd, rsmtpd, qmail, zmail, etc.
usb - daemon for devices on Universal Serial Bus .
xfs - X font server
xntpd - finds the server for a NIS domain and stores the information about it in a binding file
ypbind - NIS binder. Needed if computer is part of Network Information Service domain.

Go to Part: 4.5 - Networking