TCP/IP and Data Communications Administration Guide

/etc/uucp/Systems File

The /etc/uucp/Systems file contains the information needed by the uucico daemon to establish a communication link to a remote computer. It is the first file you need to edit to configure UUCP.

Each entry in the Systems file represents a remote computer with which your host communicates. A particular host can have more than one entry. The additional entries represent alternative communication paths that are tried in sequential order. In addition, by default UUCP prevents any computer that does not appear in /etc/uucp/Systems from logging in to your host.

Using the Sysfiles file, you can define several files to be used as Systems files. See the description of the Sysfiles file for details.

Each entry in the Systems file has the following format:

System-Name
 Time
 Type 
Speed 
Phone  
Chat-Script 

Example 12-1 showing the fields of the Systems file.


Example 12-1 Fields in /etc/uucp/Systems


System-Name Time Type  Speed Phone   Chat Script
Arabian     Any  ACUEC 38400 111222  Login: Puucp ssword:beledi  

System-Name Field

This field contains the node name of the remote computer. On TCP/IP networks, this can be the machine's host name or a name created specifically for UUCP communications through the /etc/uucp/Sysname file. See "/etc/uucp/Sysname File". In Example 12-1, the System-Name field contains an entry for remote host arabian.

Time Field

This field specifies the day of week and time of day when the remote computer can be called. The format of the Time field is:

daytime[;retry]

The day portion can be a list containing some of the following entries:

Table 12-1 Day Field

Su Mo Tu We Th Fr Sa

For individual days 

Wk

For any weekday 

Any

For any day 

Never

Your host never initiates a call to the remote computer; the call must be initiated by the remote computer. Your host is then operating in passive mode.

Example 12-1 shows Any in the Time field, indicating that host arabian can be called at any time.

The time portion should be a range of times specified in 24-hour notation. (Example: 0800-1230 for 8:30 a.m. to 12:30 p.m.) If no time portion is specified, any time of day is assumed to be allowed for the call.

A time range that spans 0000 is permitted. For example, 0800-0600 means all times are allowed other than times between 6 a.m. and 8 a.m.

Retry Subfield

The Retry subfield enables you to specify the minimum time (in minutes) before a retry, following a failed attempt. The default wait is 60 minutes. The subfield separator is a semicolon (;). For example, Any;9 is interpreted as call any time, but wait at least 9 minutes before retrying after a failure occurs.

If you do not specify a retry entry, an exponential back-off algorithm is used. What this means is that UUCP starts with a default wait time that grows larger as the number of failed attempts increases. For example, suppose the initial retry time is 5 minutes. If there is no response, the next retry is 10 minutes later. The next retry is 20 minutes later, and so on until the maximum retry time of 23 hours is reached. If retry is specified, that is always the retry time. Otherwise, the back-off algorithm is used.

Type Field

This field contains the device type that should be used to establish the communication link to the remote computer. The keyword used in this field is matched against the first field of Devices file entries as shown in Example 12-2. (Note that the fields listed in the table heading are for the Systems file and do not apply to the Devices file. For a table showing the same correspondences to fields in the Devices file, see Example 12-6.)


Example 12-2 Type Field and /etc/uucp/Devices File


File Name System-Name  Time  Type     Speed  Phone     Chap-Script
 
Systems   arabian      Any   ACUEC, g 38400  1112222   ogin: Puucp ssword:beledi
 
Device    ACUEC        cua/a -        38400  usrv32bis-ec
 

You can define the protocol used to contact the system by adding it on to the Type field. The example above shows how to attach the protocol g to the device type ACUEC. (For information on protocols, see "Protocol Definitions in the Devices File".)

Speed Field

This field (also known as the Class field) specifies the transfer speed of the device used in establishing the communication link. It can contain a letter and speed (for example, C1200, D1200) to differentiate between classes of dialers (refer to "Class Field").

Some devices can be used at any speed, so the keyword Any can be used. This field must match the Class field in the associated Devices file entry as shown in Example 12-3:


Example 12-3 Speed Field and /etc/uucp/Devices File


File Name System-Name Time  Type    Speed  Phone   Chap-Script
 
Systems   eagle       Any   ACU, g  D1200  NY3251  ogin: nuucp ssword: Oakgrass
 
Device    ACU         tty11 --      D1200  penril

If information is not required for this field, use a dash (-) as a place holder for the field.

Phone Field

This field allows you to specify the telephone number (token) of the remote computer for automatic dialers (port selectors). The telephone number consists of an optional alphabetic abbreviation and a numeric part. If an abbreviation is used, it must be one that is listed in the Dialcodes file, as shown in Example 12-4:


Example 12-4 Phone Field Correspondence


File Name System-Name  Time  Type  Speed  Phone     Chap-Script
 
Systems   nubian       Any   ACU   2400   NY5551212 ogin: Puucp ssword:Passuan
 
Dialcodes NY 1-1212

In the System-Name string, an equals sign (=) tells the ACU to wait for a secondary dial tone before dialing the remaining digits. A dash (-) in the string instructs the ACU to pause four seconds before dialing the next digit.

If your computer is connected to a port selector, you can access other computers connected to that selector. The Systems file entries for these remote machines should not have a telephone number in the Phone field. Instead, this field should contain the token to be passed on to the switch. In this way, the port selector knows the remote machine with which your host wants to communicate. (This is usually just the system name.) The associated Devices file entry should have a \D at the end of the entry to ensure that this field is not translated using the Dialcodes file.

Chat-Script Field

This field (also called the Login field) contains a string of characters called a chat script. The chat script contains the characters the local and remote machines must pass to each other in their initial conversation. Chat scripts have the format:

expect send [expect send] ....

expect represents the string that the local host expects to get from the remote host to initiate conversation. send is the string the local host sends after it receives the expect string from the remote host. A chat script can have more than one expect-send sequence.

A basic chat script might contain:

The expect field can be made up of subfields of the form:

expect[-send-expect]...

where -send is sent if the prior expect is not successfully read, and -expect following the send is the next expected string.

For example, with strings login--login, the UUCP on the local host expects login. If UUCP gets login from the remote machine, it goes to the next field. If it does not get login, it sends a carriage return, then looks for login again. If the local computer initially does not expect any characters, use the characters "" (NULL string) in the expect field. All send fields are sent followed by a carriage-return unless the send string is terminated with a \c.

Here is an example of a Systems file entry that uses an expect-send string:


sonora Any ACUEC 9600 2223333 "" \r \r ogin:-BREAK-ogin: Puucpx ssword: xyzzy

This example tells UUCP on the local host to send two carriage-returns and wait for ogin: (for Login:). If ogin: is not received, send a BREAK. When you do get ogin: send the login name Puucpx. When you get ssword: (for Password:), send the password xyzzy.

Table 12-2 lists some useful escape characters.

Table 12-2 Escape Characters Used in Systems File Chat Script

\b

Send or expect a backspace character. 

\c

If at the end of a string, suppress the carriage return that is normally sent. Ignored otherwise. 

\d

Delay 1-3 seconds before sending more characters. 

\E

Start echo checking. (From this point on, whenever a character is transmitted, it waits for the character to be received before doing anything else.) 

\e

Echo check-off.  

\H

Ignore one hangup. Use this option for dialback modems. 

\K

Send a BREAK character. 

\M

Turn on CLOCAL flag.

\m

Turn off CLOCAL flag.

\n

Send or expect a newline character. 

\N

Send a NULL character (ASCII NUL). 

\p

Pause for approximately 1/4 to 1/2 second. 

\r

Send or expect a carriage return. 

\s

Send or expect a space character. 

\t

Send or expect a tab character. 

EOT

Send an EOT followed by newline twice. 

BREAK

Send a break character. 

\ddd

Send or expect the character represented by the octal digits (ddd).

Enabling Dialback Through the Chat Script

Some companies set up dial-in servers to handle calls from remote computers. For example, your company might have a dial-in server with a dialback modem that employees can call from their home computers. After the dial-in server identifies the remote machine, it disconnects the link to the remote machine and then calls the remote machine back. The communications link is then reestablished.

You can facilitate dialback by using the \H option in the Systems file chat script at the place where dialback should occur. Include the \H as part of an expect string at the place where the dial-in server is expected to hang up.

For example, suppose the chat script that calls a dial-in server contains the following string:


INITIATED\Hogin:

The UUCP dialing facility on the local machine expects to get the characters INITIATED from the dial-in server. After the INITIATED characters have been matched, the dialing facility flushes any subsequent characters it receives until the dial-in server hangs up. The local dialing facility then waits until it receives the next part of the expect string, the characters ogin:, from the dial-in server. When it receives the ogin:, the dialing facility then continues through the chat script.

You need not have a string of characters directly preceding or following the \H, as shown in the sample string above.

Hardware Flow Control

You can also use the pseudo-send STTY=value string to set modem characteristics. For instance, STTY=crtscts enables hardware flow control. STTY accepts all stty modes. See the stty(1) and termio(4) man pages for complete details.

The following example would enable hardware flow control in a Systems file entry:


unix Any ACU 2400 12015551212 "" \r login:-\r-login:-\r-login: 
nuucp password: xxx "" \ STTY=crtscts 

This pseudo-send string can also be used in entries in the Dialers file.

Setting Parity

In some cases, you have to reset the parity because the system that you are calling checks port parity and drops the line if it is wrong. The expect-send couplet "" P_ZERO sets the high-order bit (parity bit) to 0. For example:


unix Any ACU 2400 12015551212 "" P_ZERO "" \r login:-\r-login:-\r-login: 
nuucp password: xxx 

In the same manner, P_EVEN sets parity to even (the default), P_ODD sets odd parity, and P_ONE sets the parity bit to 1.

The parity couplet can be inserted anywhere in the chat script. It applies to all information in the chat script following the "" P_ZERO. It can also be used in entries in the Dialers file.