Выбрать главу

After completing authorization, the remote end is assumed to fire up its own uucico. The two then enter the handshake phase described in the previous section.

Figure 16.1 illustrates the dependencies among configuration files.

Figure 16.1: Interaction of Taylor UUCP configuration files

What UUCP Needs to Know

Before you start writing the UUCP configuration files, you have to gather some information that UUCP requires.

First, you have to figure out what serial device your modem is attached to. Usually, the (DOS) ports COM1: through COM4: map to the device special files /dev/ttyS0 through /dev/ttyS3. Some distributions, such as Slackware, create a link called /dev/modem to the appropriate ttyS* device file, and configure kermit, seyon, and any other communication programs to use this generic file. In this case, you should use /dev/modem in your UUCP configuration, too.

The reason for using a symbolic link is that all dial-out programs use so-called lock files to signal when a serial port is in use. The names of these lock files are a concatenation of the string LCK… and the device filename, for instance LCK…ttyS1. If programs use different names for the same device, they will fail to recognize each other's lock files. As a consequence, they will disrupt each other's session when started at the same time. This is quite possible when you schedule your UUCP calls using a crontab entry. For details on serial port setup, please refer to Chapter 4, Configuring the Serial Hardware.

Next, you must find out at what speed your modem and Linux will communicate. You have to set this speed to the maximum effective transfer rate you expect to get. The effective transfer rate may be much higher than the raw physical transfer rate your modem is capable of. For instance, many modems send and receive data at 56 kbps. Using compression protocols such as V.42bis, the actual transfer rate may climb over 100 kbps.

Of course, if UUCP is to do anything at all, you need the phone number of a system to call. Also, you need a valid login ID and possibly a password for the remote machine.[91]

You also have to know exactly how to log into the system. Do you have to press the Enter key before the login prompt appears? Does it display login: or user:? This is necessary for composing the chat script. If you don't know, or if the usual chat script fails, try to call the system with a terminal program like kermit or minicom and record exactly what you have to do.

Site Naming

As with TCP/IP-based networking, your host has to have a name for UUCP networking. As long as you simply want to use UUCP for file transfers to or from sites you dial up directly, or on a local network, this name does not have to meet any standards.[92]

However, if you use UUCP for a mail or news link, you should think about having the name registered with the UUCP Mapping Project.[93] The UUCP Mapping Project is described in Chapter 17, Electronic Mail. Even if you participate in a domain, you might consider having an official UUCP name for your site.

Frequently, people choose their UUCP name to match the first component of their fully qualified domain name. Suppose your site's domain address is swim.twobirds.com; then your UUCP hostname would be swim. Think of UUCP sites as knowing each other on a first-name basis. Of course, you can also use a UUCP name completely unrelated to your fully qualified domain name.

However, make sure not to use the unqualified site name in mail addresses unless you have registered it as your official UUCP name. At the very best, mail to an unregistered UUCP host will vanish in some big black bit bucket. If you use a name already held by some other site, this mail will be routed to that site and cause its postmaster a lot of headaches.

By default, the UUCP suite uses the name set by hostname as the site's UUCP name. This name is commonly set by a command on the boot time rc scripts, and is usually stored in the /etc/hostname. If your UUCP name is different from what you set your hostname to, you have to use the hostname option in the config file to tell uucico about your UUCP name. This is described next.

Taylor Configuration Files

We now return to the configuration files. Taylor UUCP gets its information from the following files:

config

This is the main configuration file. You can define your site's UUCP name here.

sys

This file describes all known sites. For each site, it specifies its name, what times to call it, which number to dial (if any), what type of device to use, and how to log on.

port

This file contains entries describing each available port, together with the line speed supported and the dialer to be used.

dial

This file describes dialers used to establish a telephone connection.

dialcode

This file contains expansions for symbolic dial codes.

call

This file contains the login name and password to be used when calling a system. Rarely used.

passwd

This file contains login names and passwords that systems may use when logging in. It is used only when uucico does its own password checking.

Taylor configuration files are generally made up of lines containing keyword-value pairs. A hash sign introduces a comment that extends to the end of the line. To use a hash sign to mean itself, escape it with a backslash like this: \#.

There are quite a number of options you can tune with these configuration files. We can't go into all the parameters, but we will cover the most important ones here. Then you should be able to configure a modem-based UUCP link. Additional sections describe the modifications necessary if you want to use UUCP over TCP/IP or over a direct serial line. A complete reference is given in the Texinfo documents that accompany the Taylor UUCP sources.

When you think you have configured your UUCP system completely, you can check your configuration using the uuchk tool (located in /usr/lib/uucp). uuchk reads your configuration files and prints out a detailed report of the configuration values used for each system.

General Configuration Options Using the config File

You won't generally use this file to describe much beside your UUCP hostname. By default, UUCP will use the name you set with the hostname command, but it is generally a good idea to set the UUCP name explicitly. Here's a sample config file:

# /usr/lib/uucp/config - UUCP main configuration file

hostname vstout

A number of miscellaneous parameters can be set here too, such as the name of the spool directory or access rights for anonymous UUCP. The latter will be described later in this chapter in the section "Anonymous UUCP."

How to Tell UUCP About Other Systems Using the sys File

The sys file describes the systems that your machine knows about. An entry is introduced by the system keyword; the subsequent lines up to the next system directive detail the parameters specific to that site. Commonly, a system entry defines parameters such as the telephone number and login chat.

вернуться

91

If you're just going to try out UUCP, get the number of an archive site near you. Write down the login and password - they're public to make anonymous downloads possible. In most cases, they're something like uucp/uucp or nuucp/uucp.

вернуться

92

The only limitation is that it shouldn't be longer than seven characters, so as to not confuse UUCP implementations that run on an operating system that imposes a narrow limit on filenames. Names that are longer than seven characters are often truncated by UUCP. Some versions even limit the name to six characters.

вернуться

93

The UUCP Mapping Project registers all UUCP hostnames worldwide and makes sure they are unique.