Chapter 7: Connecting to other computers with UUCP

Table of contents

Chapter 7

Connecting to other computers with UUCP

Use UUCP (``UNIX-to-UNIX Copy'') to build a remote network system for your computer using normal telephone lines and modems. If your computer is on a local area network or is running TCP/IP, you probably do not need to set up UUCP. Local area networks and TCP/IP networks provide continuous connections that may be used in many ways, whereas UUCP provides only a scheduled file transfer capability.


NOTE: UUCP is not a terminal emulation program. To log on to another computer over a modem, see Chapter 24, ``Adding modems'' in the SCO OpenServer Handbook and follow the instructions for connecting a modem.

The UUCP package consists of a group of programs that provide remote file transfer (uucp), remote command execution (uux), and mail to and from remote sites. 

See also:

Setting up a simple UUCP connection

This section describes how to establish a modem-based UUCP connection to another computer. The connection described is a simple one-to-one connection between two systems using Hayes-compatible modems, or any modem specifically supported by a dialer binary (for example, Telebit, Multitech, or US Robotics). Both sites are able to dial into each other. It is assumed that the modem on each site is connected to /dev/tty1A. (If your modem is attached to a different serial port, you will need to change this.) Finally, it is assumed that the modems are connected by a hardware-handshaking cables. For more detailed information and for other UUCP configurations, see ``Configuring UUCP''.

To set up the standard UUCP system, you need:

at least one RS-232 serial line (or serial port) on your computer to use for UUCP. 

the UUCP Utilities and Mail Utilities. If not installed, use the Software Manager or custom(ADM).

a modem, configured as described in the Chapter 24, ``Adding modems'' in the SCO OpenServer Handbook. 

a standard telephone jack for access to the telephone system.

a cable to connect the serial port to the modem.

To set up the connection, edit the /usr/lib/uucp/Systems and /usr/lib/uucp/Devices files. You can use the UUCP Manager/uuinstall utility to help you do this.

The Systems file in /usr/lib/uucp contains a list of the systems that UUCP knows about, and specifies the device and method used to contact each system. The Devices file identifies the usable devices, speed to use, and the serial ports that the devices are connected to.

To configure UUCP on a computer called topaz:

  1. Make a note of the:

    modem speed to use in making the connection.

    name of your computer (called topaz in this example).

    name of the other UUCP host (called emerald in this example).

    serial line connected to the modem (/dev/tty1A in this example).

    login and password to use when connecting to the remote machine (if you do not know these, the remote system's administrator should be able to tell you).
    

  2. Log in as root and run the UUCP Manager located in the Networks directory of the SCOadmin hierarchy, or use the uuinstall(ADM) command line. You see this menu:
                        UUCP Administration Utility
                        ===========================
       

    1. Display or update site name 2. Display or update list of remote sites (Systems) 3. Display or update direct- or dial-out lines (Devices) 4. Display or update direct- or dial-in lines (/etc/inittab) 5. Check consistency of UUCP files 6. Test connection with remote site 7. Convert old UUCP files to new format

    Choose an option (1-7), or q to quit :

  3. Select Display or update site name. You will be given options to display or update the local site name. Ensure that the site name for your system is correct.

  4. Return to the main menu (by pressing <q>) and select Display or update list of remote sites, which edits the /usr/lib/uucp/Systems file. You see a menu like this:
            Display or update list of remote sites (Systems)
            ================================================
       

    1. Display the Systems file 2. Add a new site entry 3. Delete a site entry 4. Change a site entry

    Choose an option (1-4), or q to quit :

    Select Add a new site entry. uuinstall prompts you to enter information about the new site a line at a time:
       Site name	: emerald
       Schedule	: Any
       Device type	: ACU
       Speed range	: 2400
       Phone number	: 0123456789
       Expect login	: ogin:-@-ogin:-@-ogin:
       Send login	: topaz
       Expect login	: ssword:
       Send login	: bbsuucp
    
    These fields are described in detail in ``Adding entries for remote sites to the Systems file''.

  5. Review your site entry, then type <q> to go back to the main menu. Now select Display or update direct- or dial-out lines.

    You should see a menu like this:

       Display or update direct- or dial-out lines (Devices)
       =====================================================
       

    1. Display the Devices file 2. Add a new device entry 3. Delete a device entry 4. Change a device entry

    Choose an option (1-4), or q to quit :

    Having defined a site to contact, it is necessary to configure the device used to contact the site. In the Systems file (step 4) you specified that the device ACU should be used. So it is necessary to add (or change) the device entry for ACU:
       Device type	? ACU
       Tty line	? tty1A
       Dialer line	? -
       Speed range	? 2400   
       Dialer		? hayes2400
       Switch token	?
       New entry is accepted : 
    
    These fields are described in detail in ``Specifying dial-up parameters with the Devices file''. (If you are not using a Hayes compatible modem, you may need to change the ``Dialer'' field, and optionally the ``Speed range'' field.) Use the dialer same dialer name that you used when you configured your modem. The dialers provided are described in ``Using dialers'' in the SCO OpenServer Handbook.

    After adding or updating the ACU device, you should return to the main menu.

  6. If you do not want to permit emerald to log in on your system, skip this step. Select Display or update direct- or dial-in lines to update /etc/inittab to permit UUCP to receive logins on the appropriate device (/dev/tty1A). You should see a menu like this:
       Display or update direct- or dial-in lines (/etc/inittab)
       =========================================================
       

    1. Display inittab file 2. Enable login on a line 3. Disable login on a line

    Select Enable login on a line to enable login on a line, and enter the name of the line. (Display the inittab file for a list of acceptable lines.) Note that if the kernel is subsequently relinked, it is necessary to reenable any lines allocated for UUCP logins.

  7. Quit from uuinstall. Edit /usr/lib/uucp/Permissions to specify the kind of access that your system (topaz) has to the other host (emerald) when dialing out, and the access emerald has to your system when dialing in. Add the following text:


    LOGNAME=emerald \
    MACHINE=emerald \
    COMMANDS=rmail:rnews \
    READ=/usr/spool/uucppublic \
    WRITE=/usr/spool/uucppublic \
    SENDFILES=call \
    REQUEST=yes \

    These fields are described in ``Limiting access with the Permissions file''.

  8. If you are permitting incoming calls, assign a login name and password for the machine calling you. For example, if emerald calls you, you should create an account for it. See ``Creating login accounts for sites dialing in'' for details. You must tell the administrator of the other machine what the password is, so that they can configure their Systems file login script for your host (topaz).

  9. To permit incoming calls, return to uuinstall and select Display or update direct- or dial-in lines. This lets you display, enable, or disable the devices on your system. You must enable the device used by ACU before UUCP can receive incoming calls.

  10. Run uuinstall and select Check consistency of UUCP files. This will tell you if there are any incorrect permissions or detectable inconsistencies in your UUCP configuration.

  11. To test the UUCP connection from topaz to emerald, select Test connection with remote site. uuinstall prompts you for the name of the site to contact, then runs a UUCP test session. See ``Testing the UUCP connection'' for more details of testing a connection.

Testing the UUCP connection

To test your UUCP connection:

  1. If you are configuring an outbound UUCP connection, cu must function in order for UUCP to work. Follow the instructions for configuring and testing the modem in Chapter 24, ``Adding modems'' in the SCO OpenServer Handbook. 

  2. If you are using a Hayes or compatible modem, make sure the volume on the modem is at an appropriate level. You must be able to hear the modem to carry out this test successfully.

  3. Ensure that the Systems file has an entry for the system you intend to call, and that the Devices file has a matching entry for ttynn.

  4. Start the uutry program by entering: 

    /usr/lib/uucp/uutry -r -x9 sitename


    NOTE: The output from this test can be found in /tmp/sitename. If you need to call your provider for assistance, it is a good idea to save this output.

    See ``How a UUCP transmission proceeds'' for a discussion of the output from uutry.

  5. Listen carefully to the modem. You should hear each digit as the number is dialed, then hear a high-pitched signal when the other modem connects, followed by silence.

  6. The dialer automatically disconnects any call that it cannot complete. To break out of the shell created by uutry, press <Del> or <BREAK>. This returns control to the terminal while uucico continues to run, sending the output to a file in /tmp with the name of the system called.

  7. If the signal is not present, make certain:

  8. If you do not hear the modem dial, make certain:

    Changing the system name

    For instructions on altering the host or system name, see ``Changing the system name'' in the Mail and Messaging Guide.

    Configuring UUCP

    The example installation described in ``Setting up a simple UUCP connection'' assumes the most simple kind of UUCP network in common use: a modem to modem connection between two peer systems. Once your connection is established you can customize the data transfer protocol, system contact information, access permissions, and modem parameters. Alternatively, other kinds of UUCP network (for example, UUCP over TCP/IP) can be configured.

    For information on these procedures, see: 


    NOTE: If you are planning to route mail over your UUCP system, see ``Running the MMDF Configuration Manager'' in the Mail and Messaging Guide for instructions on configuring mail traffic to work over UUCP. 

    See ``How UUCP works'' for a description of the functions of the UUCP configuration files mentioned in ``Setting up a simple UUCP connection''. Read ``How UUCP works'' carefully before running uuinstall so that you understand the UUCP database.

    Setting up maintenance scripts

    There are several aspects of system operation that are governed by shell scripts running as daemons. These scripts must be set up by the system administrator. See the uudemon(ADM) manual page for complete instructions.

    Setting up polling

    Dial-up UUCP systems are normally configured to exchange files automatically at regular intervals. Each time a scheduled exchange is due, the UUCP system polls the dial-in system to see if files are waiting to be transferred.

    Use uudemon.poll2 to set up the polling schedule. To run uudemon.poll2, you need an entry for the daily daemon and an entry for the hourly daemon in the /usr/spool/cron/crontabs/uucp file as follows:

       0 0 * * *	/usr/lib/uucp/uudemon.poll2 -d
       0 * * * *	/usr/lib/uucp/uudemon.poll2
    
    The -d flag refers to the daily daemon. The hourly daemon has no flags. The above example has the daemon run at midnight. You can change the time the daemon runs by altering the second field using a 24-hour clock.

    To establish the hours and days that uudemon.poll2 runs, create two files: /usr/lib/uucp/Poll.hour and /usr/lib/uucp/Poll.day. These files contain the systems to be polled and the times and days they are polled.

    A sample Poll.hour file follows:

       hanna	12 1 3
       raven	2 6 10w
    
    If the hour is followed by a ``w'', uudemon.poll2 calls the site only if there is work to be done.

    A sample Poll.day file follows:

       hanna	1 3 6
       raven	1 2 3 4 5
    
    The days of the week are integers, with Sunday being 0.

    Creating login accounts for sites dialing in

    A dial-in site must provide a login entry for the sites that call it.

    A UUCP login account is the same as an ordinary user account but it has a special login directory and login program instead of the normal user directory and shell. 


    NOTE: ``uucp'' should not be used as the name of a UUCP user or login account. It is the name of the UUCP owner or administrator.

    To create a UUCP login entry:

    1. Choose a new user name and a user ID (identification number) for the UUCP login. The name can be any combination of letters and digits that is no more than eight characters long. The user ID must be an integer in the range 50 to 65535.

      Make sure the name and ID are unique. A UUCP login entry must not have the same name or ID as any other login entry.

    2. Use the following information to create the account:

      Login shell: uucp (/usr/lib/uucp/uucico)
      Home directory: /usr/spool/uucplogins/username 

    3. To create an account, see ``Adding and modifying user accounts''.

    Passwords are optional, but recommended, for UUCP logins. For information about what happens when a UUCP system with no account tries to dial in, see ``Preventing unknown sites from logging in''.

    Disabling password expiration and locks for UUCP accounts

    UUCP login accounts are created with no password expiration. To alter this, see ``Controlling password expiration''.


    NOTE: Remember that UUCP login accounts are used by remote systems using a login script which cannot cope with a prompt for a new password. For this reason it is sensible to set up an infinite password expiration, with the password changed manually in consultation with the remote site using that UUCP login.

    If you have difficulties with UUCP accounts being locked (messages like dead account are displayed), you can change the number of login attempts by selecting as described in ``Locking or unlocking a user account''.

Adding entries for remote sites to the Systems file

The Systems file (/usr/lib/uucp/Systems) contains the information needed by the uucico daemon to establish a communications link to a remote computer. Each entry in the file represents a computer that can be called by your computer.


NOTE: If you plan to route mail traffic over UUCP, you must also configure MMDF as described in ``Running the MMDF Configuration Manager'' in the Mail and Messaging Guide. 

In addition, the Systems file can be configured to prevent any computer that does not appear in this file from logging in on your computer. More than one entry may be present for a particular computer. The additional entries represent alternative communication paths that can be tried in sequential order.


NOTE: If you are setting up your system as a dial-in only (passive) site that never initiates calls, you only need to add the names of the systems that will be calling you with the keyword ``Never'' as in this example:
   guardian Never


Each entry in the Systems file has the following format (each field must be separated by a space): 

sitename schedule device speed phone login-script

where:

sitename
contains the node name of the remote computer. 

schedule
is a string that indicates the day-of-week and time-of-day when the remote computer can be called.

device
is the device type that should be used to establish the communications link to the remote computer.

speed
indicates the transfer speed (or range) of the device used in establishing the communications link.

phone
provides the phone number of the remote computer for automatic dialers. If you wish to create a portable Systems file that can be used at a number of sites where the dialing prefixes differ (for internal phone systems), refer to ``Creating a portable UUCP Systems file'' .

login-script
contains login information (also known as a ``chat script''). This is explained in ``Creating login scripts''. 

The schedule field

The schedule field consists of three subfields. The first, day, is required. The other two, time and retry, are optional. The syntax is as follows:

day[time][;retry]

The day subfield can contain the following keywords:

Su Mo Tu We
Th Fr Sa
for individual days

Wk
for any weekday (Monday-Friday)

Any
for anytime

Never
for a passive arrangement with the remote computer. If the schedule field is Never, your computer never initiates a call to the remote computer. (This field is ignored when you set up polling with uudemon.poll2; see ``Setting up polling'' for details.) The call must be initiated by the remote computer. In other words, your computer is in a passive mode with respect to the remote computer (see ``Limiting access with the Permissions file'' for details ).
The optional time subfield should be a range of times in 24-hour clock format, such as 0800-1230. If no time 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:00am and 8:00am.

For example, the following permits calls on Mondays, Wednesdays, and Fridays between the hours of 9:00am and noon (the schedule field is in boldface for clarity): 

   grebe MoWeFr0900-1200 ACU D1200 14087672676 ogin:
    nuucp ssword: Crested
You can also specify more than one set of day and time entries by separating them with commas. This is useful for more complex specifications. The following example allows calls from 5:00pm to 8:00pm, Monday through Thursday, and calls any time on Saturday and Sunday. This example would be an effective way to call only when phone rates are low, if immediate transfer is not critical:
   gorgon Wk1700-0800,SaSu ACU D1200 14087672676 ogin:
    nuucp ssword: DontLook
The optional subfield, retry, is available to specify the minimum time (in minutes) before a retry following a failed attempt. The subfield separator is a semicolon (;). For example, the following is interpreted as ``call any time, but wait at least 9 minutes before retrying after a failure occurs'':
   Any;9
By default, UUCP uses a method called exponential backoff to allow retry of failed calls. UUCP does not allow another call to go through until after the retry time has elapsed. This interval expands exponentially as the number of unsuccessful attempts increases. The retry field overrides the exponential backoff algorithm. If you set the retry field to 9, for example, UUCP allows another attempt to connect 9 minutes after each failure. The retry field cannot be set lower than 5 minutes.

UUCP does not automatically try a failed call again. You must have polling set up as described in ``Setting up polling'' or manually invoke uucico(ADM). Any files not transferred due to a connection failure are transferred at the next successful connection to that system.

The device field

The device field selects the device type, in most cases an ACU (Automatic Call Unit). For example, the keyword used in the following field is matched against the first field of Devices file entries:

Systems: gorgon Any ACU D1200 14087672676 ogin:
nuucp ssword: DontLook

Devices: ACU tty2A - 1200 /usr/lib/uucp/dialHA12

Additional documentation on the device field is located in the /usr/lib/uucp/Systems file supplied with your system.

The speed field

This field can contain a letter and speed (for example, C1200, D1200) to differentiate between classes of dialers -- refer to ``The speed field''. Some devices can be used at any speed, so the keyword Any can be used. However, we recommend that you specify the actual range of speeds that can be used. (If Any is used in both Systems and Devices entries, 1200 is assumed.) For example, this field must intersect the speed field in the associated Devices file entry:

Systems: gorgon Any ACU D2400-9600 14087672676 ogin:
nuucp ssword: DontLook

Devices: ACU tty1A - D2400-9600 /usr/lib/uucp/dialHA9600

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

Variable rate modems

Some modems can determine the connection baud rate from the carrier sent by a remote system. These modems inform the local system of the connection baud rate before issuing the Carrier Detect (CD) signal. The Hayes 2400 dialer supplied with UUCP detects different connection baud rates and informs UUCP and cu when it exits with a successful connection. 

The speed fields in Devices and Systems can specify a range of baud rates for a connection. If a dialer supports baud rates from 300 to 2400 baud, enter the baud rate range in the speed field of Devices as follows: 

300--2400

If a dialer or modem does not allow variable baud rates, place a single baud rate in the speed field. If a remote system supports several different speeds, place the range of baud rates in the speed field of Systems. If the remote system connects at a single baud rate, place that number in Systems. UUCP passes the highest common speed of the Systems and Devices baud rate ranges to the dialer when connecting. If the dialer connects outside of the baud range in the Systems file, it returns a bad baud rate error. Otherwise, it returns the baud rate of the connection.

The phone field

This field provides the phone number used for the modem dialer. The phone number is made up 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. (See ``Creating a portable UUCP Systems file'' for details.) For example:

Systems: gorgon Any ACU D1200 CA2676 ogin:
nuucp ssword: DontLook

Dialcodes: CA 9=408767

In this string, an equal 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 2 seconds before dialing the next digit.


NOTE: Most dialers treat the equal sign as a pause, so you may need to use more than one.

Do not use the comma (from the Hayes command set) in a Systems file entry when you wish to indicate a pause. Use hyphens instead.


If your computer is connected to a LAN switch or port selector, you can access other computers that are connected to that switch. The Systems file entries for these computers do not have a phone number in the phone field. Instead, this field contains the token that must be passed on to the switch so it knows which computer your computer wishes to communicate with. (This is usually just the system name.) The associated Devices file entry should have a ``\D'' at the end of the entry to prevent translation using the Dialcodes entry. 

The login-script field

The login-script opens communications between modems, and also recognizes and sends proper login and password sequences. The script a series of space-separated fields and subfields of the following format:

expect send

where expect is the string that is received, and send is the string that is sent when the expect string is received. 

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

expect[-subsend-subexpect]...

where the subsend is sent if the prior expect is not successfully read and the subexpect following the subsend is the next expected string. To make this distinction clear: the send-expect sequence sends a string if the expect string is received; the subsend-subexpect sends only if the prior expect string is not received within 10 seconds.

For example, with ``login:--login:'', the UUCP program expects ``login:''. If a ``login:'' is received, it goes on to the next field. If it does not get ``login:'', it sends nothing followed by a carriage return, then looks for ``login:'' again. If no characters are initially expected from the remote computer, the null string ("") should be used in the first expect field. Note that all send fields are sent followed by a carriage return unless the send string is terminated with a ``\c''. 

If an expect string starts with a dash, it is interpreted as a null expect string followed by a subsend string. For example, ``--login:'' sends a carriage return and then expects a ``login:''.

The expect string need not be complete; only the trailing characters must be specified, as in ``ogin:''. This avoids difficulties with login strings that use an uppercase letter as in ``Login:'' or ``Password:'', and also difficulties when the line is shared by dial-in and dial-out. 

Creating login scripts

This section explains in greater detail how to create a login (``chat'') script.

Consider the following sample Systems file entry:

   terps Any ACU 1200 18005211980 "" \r ogin:-BREAK-ogin:
    uucpx word: ichore
This is how this script would work during connection:

  1. Nothing is expected initially.

  2. A carriage return is sent and the script waits for the prompt ``ogin:'' (login:).

  3. If it does not receive ``ogin:'', send a BREAK signal.

  4. When ``ogin:'' is finally received, send the login name uucpx.

  5. When the prompt ``word:'' (for Password:) is received, send the password ichore. 
Login scripts often require some experimentation. There are cases that require one or more BREAK sequences before presenting a login (this is often true with variable speed modems). If you cannot obtain the necessary login sequence from the system administrator for a given site, it is a good idea to connect with the site manually. You can accomplish this using cu and find out what must be sent to generate a login prompt. (You can also connect with a system using a uutry for debugging; see ``Testing the UUCP connection'' for details. There are several escape characters that cause specific actions when sent during the login sequence, some of which correspond to keystrokes; these should be included in the script where necessary. 

Table 7-1 Login (Chat) script escape sequences

 ------------------------------------------------------
 Character   Description
 ------------------------------------------------------
 \N          sends a null character (ASCII NULL).
 \b          sends or expects a backspace character.
 \c          if at the end of a string, suppresses the
             carriage return that is normally sent.
             Ignored otherwise.
 \d          delays two seconds before sending or
             reading more characters.
 \p          pauses for approximately ¼ to ½ second.
 \E          starts echo checking. (After this sequence
             is used, whenever a character is
             transmitted, the system waits for the
             character to be received before doing
             anything else.)
 \e          turns echo check off.
 \n          sends or expects a newline character.
 \r          sends or expects a carriage-return.
 \s          sends or expects a space character.
 \t          sends or expects a tab character.
 \\          sends or expects a ``\'' character.
 EOT         sends EOT (end of transmission or <Ctrl>d)
 BREAK       sends a BREAK signal.
 \K          same as BREAK.
 \ddd        collapses the octal digits (ddd) into a
             single character whose value is the ASCII
             character represented by that number (for
             example: \007).
 ""          expects a null string.

Specifying dial-up parameters with the Devices file

The Devices file (/usr/lib/uucp/Devices) contains information for all the devices that can be used to establish a link to a remote computer. Devices are Automatic Call Units, direct links, or network connections. This file works closely with the Dialers, Systems, and Dialcodes files. Before you make changes in any of these files, you should be familiar with them all. A change to an entry in one file may require a change to a related entry in another file.

Each entry in the Devices file has the following format: 

type ttyline dialerline speed dialer-token

where:

type
contains one of two keywords (Direct or ACU), the name of a Local Area Network switch, or a system name. 

ttyline
contains the device name of the port associated with the Devices entry. For example, if the automatic dial modem for a particular entry was attached to the /dev/tty1A line, the name entered in this field would be ``tty1A''.

dialerline
is useful only for 801-type dialers, which do not contain a modem and must use an additional line. Unless you have an 801 dialer, simply enter a hyphen (-) as a placeholder.

speed
is the speed or speed range of the device. Can also contain an indicator for distinguishing different dialer classes.

dialer-token
contains pairs of dialers and tokens, each representing a dialer and an argument to be passed to it. The dialer portion can be the name of a binary dialer program, a Dialers file entry, or Direct for a direct link device.

The type field

This field usually contains one of two keywords (Direct or ACU) the name of a Local Area Network switch, or a system name. 

Direct
indicates a direct link to another computer or a switch for cu connections.



ACU
indicates that the link to a remote computer is made through an Automatic Call Unit. This modem can be connected either directly to your computer or indirectly through a Local Area Network (LAN) switch. 

LANswitch
can be replaced by the name of a LAN switch. micom and develcon are supplied with caller scripts in the Dialers file. You can add your own LAN switch entries to the Dialers file. If you are adding a network using TCP/IP you would use the special dialer types TCP, TLI, or TLIS. See ``Configuring UUCP over TCP/IP'' in the Networking Guide.

sysname
indicates a direct link to a particular computer. (sysname is replaced by the name of the computer.) This means that the line associated with this Devices entry is for a particular computer in the Systems file.

For example, the keyword gorgon used in the type field of the Devices file is matched against the third field of the Systems file entry:

Devices: gorgon tty1a - 1200 direct

Systems: gorgon Any gorgon 1200 - ogin: nuucp ssword: DontLook

You can designate a protocol to use for a device within this field. For more information, see ``Defining a communications protocol''.


NOTE: Although the use of a system name adds clarity, only defined tokens can be used.



The speed field

In most cases, this is simply the speed of the device, if the keyword ACU or Direct is used in the type field. However, speed can contain a letter and a speed (for example, C1200, D1200) to differentiate between classes of dialers (Centrex or Dimension PBX). This is necessary because many larger offices may have more than one type of telephone network: one network may be dedicated to serving only internal office communications, while another handles the external communications. It is necessary to distinguish which lines are used for internal communications and which are used for external communications. The keyword used in the speed field of the Devices file is matched against the fourth field of the Systems file entries, for example:

Devices: ACU tty1A - D1200 hayes1200

Systems: gorgon Any ACU D1200 3251 ogin: nuucp ssword: DontLook

Some devices can be used at any speed, so the keyword Any can be used in the speed field. If Any is used, the line matches any speed requested in a Systems file entry. If this field is Any and the Systems file speed field is Any, the speed defaults to 1200bps. If a device can be used at a range of speeds, then the speed field can specify this range (for example, 1200--9600 or D1200--9600). This is preferable to the use of Any.

The dialer-token field

This field has the following format:

dialer [ token dialer token ... ]

For a direct line, this field contains simply the word direct, and no token is required.

For a simple connection to a dialer, this field contains the name of the dialer, and the token is omitted; by default it is taken from the phone number field of the Systems file entry.

For a dialer or a network dataswitch, this field contains the name of an entry found in the Dialers file (develcon and micom are examples of network data switches). Other dialer types are supported by binaries instead of Dialers entries. (Support for 801-type dialers is provided through use of separate lines for data and the dialer. See the Devices file for details.) UUCP recognizes a dialer as a binary if the name begins with a ``/'' or if there is an executable file by that name in /usr/lib/uucp.

For more information on Dialers entries and binaries, see ``Using dialers'' in the SCO OpenServer Handbook.

Structuring dialer-token entries

The dialer-token can be structured four different ways, depending on the device associated with the entry: 

Here are two escape characters that can appear in the dialer-token field: 

\T
indicates that the Phone field should be translated at this stage, using the Dialcodes file. This escape character is normally placed in the Dialers file for each caller script associated with an automatic dial modem (penril, ventel, and so on). The translation does not take place until the caller script is accessed.

\D
indicates that the Phone field should not be translated using the Dialcodes file. If no escape character is specified at the end of a Devices entry, ``\D'' is assumed by default when a Dialers script is to be used (which can itself contain a ``\T'' to translate the number). ``\T'' is assumed if a built-in or dialer binary is to be used (because there is then no later opportunity to translate the number).

Limiting access with the Permissions file

If other machines will be dialing into your system, the Permissions file (/usr/lib/uucp/Permissions) specifies the permissions that remote computers have with respect to login, file access, and command execution. There are options that restrict the remote computer's ability to request files and its ability to receive files queued by the local site. Other options specify the commands that a remote site can execute on the local computer.


NOTE: The following command provides a useful interpretation of the Permissions file:

/usr/lib/uucp/uucheck -v | more


Structuring Permissions file entries

Each entry is a logical line with physical lines terminated by a ``\'' to indicate continuation. Entries are made up of options delimited by spaces. Each option is a name-value pair in the following format:

name=value


NOTE: No spaces are allowed within an option assignment. This means that any continuations in an option assignment cannot have spaces before the ``\'' or at the start of the next line.

Comment lines begin with a number sign (#) and they occupy the entire line up to a newline character. Blank lines are ignored (even within multi-line entries).

There are two types of Permissions file entries: 

LOGNAME
specifies the permissions that take effect when a remote computer calls your computer.

MACHINE
specifies permissions that take effect when your computer calls a remote computer.
In this way it is possible not only to define permissions for sites calling your system, but permissions for when your site calls other machines.

Permissions file restrictions

When using the Permissions file to restrict the level of access granted to remote computers: 


NOTE: LOGNAME and MACHINE are often combined for convenience, but they function independently. For example, if a remote system logs in as nuucp, uucico will read the first entry containing LOGNAME=nuucp without regard to the MACHINE name.

Permissions options

This section describes each option, specifies how it is used, and lists its default values.

REQUEST

specifies whether the remote computer can request file transfers from your computer. When a remote computer requests a file, this request can be granted or denied. The following string specifies that the remote computer can transfer of files from your computer:
   REQUEST=yes
The following string specifies that the remote computer cannot request files from your computer:
   REQUEST=no
which is the default value (it is used if the REQUEST option is not specified). The REQUEST option can appear in either a LOGNAME (remote calls you) entry or a MACHINE (you call remote) entry.

SENDFILES

specifies whether your computer can send the work queued for the remote computer. When a remote computer calls your computer and completes its work, it may ask if your computer has work queued for it.

The following string specifies that your computer can send the work that is queued for the remote computer as long as the remote computer is logged in as one of the names in the LOGNAME option:

   SENDFILES=yes
This string is mandatory if your computer is in a passive mode with respect to the remote computer.

The following string specifies that files queued in your computer be sent only when your computer calls the remote computer:

   SENDFILES=call
The call value is the default for the SENDFILES option. This option is only significant in LOGNAME entries because MACHINE entries apply when calls are made out to remote computers. If this option is used with a MACHINE entry, it is ignored.

READ and WRITE

specify the various parts of the filesystem that uucico can read from or write to. The READ and WRITE options can be used with either MACHINE or LOGNAME entries.

The default for both the READ and WRITE options is the uucppublic directory as shown in the following strings: 

   READ=/usr/spool/uucppublic
   WRITE=/usr/spool/uucppublic
The following strings specify permission to access any file that can be read or written by UUCP.
   READ=/
   WRITE=/
The value of these entries is a colon-separated list of pathnames. The READ option is for requesting files, and the WRITE option for depositing files. One of the values must be the prefix of any full pathname of a file coming in or going out.


NOTE: READ and WRITE options do not affect the actual permissions of a file or directory. For example, a directory with permissions of 700 only permits the owner to access it, and cannot be read or written by the UUCP user, no matter what access options are defined in the Permissions file. In addition to the proper READ and WRITE options, the paths must grant appropriate permissions to the UUCP user.

To grant permission to deposit files in /usr/tmp as well as the public directory, the following values would be used with the WRITE option:

   WRITE=/usr/spool/uucppublic:/usr/tmp
It should be pointed out that if the READ and WRITE options are used, all pathnames must be specified because the pathnames are not added to the default list. For instance, if the /usr/news pathname was the only one specified in a WRITE option, permission to deposit files in the public directory would be denied.

You should be careful which directories you make accessible for reading and writing by remote systems. For example, you probably do not want remote computers to be able to write over your /etc/passwd file so /etc should not be open to writes. 

NOREAD and NOWRITE

specify exceptions to the READ and WRITE options or defaults. The following strings would permit reading any file except those in the /etc directory (and its subdirectories -- remember, these are prefixes) and writing only to the default /usr/spool/uucppublic directory:
   READ=/
   WRITE=/usr/spool/uucppublic
   NOREAD=/etc
   NOWRITE=/etc
NOWRITE works in the same manner as the NOREAD option. The NOREAD and NOWRITE options can be used in both LOGNAME and MACHINE entries.

CALLBACK

specifies in LOGNAME entries that no transaction takes place until the calling system is called back. There are two examples of when you would use CALLBACK. From a security standpoint, if you call back a machine you can be sure it is the machine it says it is. If you are doing long data transmissions, you can choose the machine that is billed for the longer call.

The following string specifies that your computer must call the remote computer back before any file transfers take place:

   CALLBACK=yes
The default for the CALLBACK option is:
   CALLBACK=no
The CALLBACK option is rarely used. If two sites have this option set for each other, a conversation never gets started.

COMMANDS

specifies the commands in MACHINE entries that a remote computer can execute on your computer. This affects the security of your system; use it with extreme care.

The uux program generates remote execution requests and queues them to be transferred to the remote computer. Files and a command are sent to the target computer for remote execution. Note that COMMANDS is not used in a LOGNAME entry; COMMANDS in MACHINE entries define command permissions whether you call the remote system or it calls you.

The default command that a remote computer can execute on your computer is: 

   COMMANDS=rmail
If a command string is used in a MACHINE entry, the default commands are overridden. For instance, the following entry overrides the COMMAND default so that the computers owl, raven, hawk, and dove can now execute rmail, rnews, and lp on your computer:
   MACHINE=owl:raven:hawk:dove \
   COMMANDS=rmail:rnews:lp
Full pathnames of commands can also be used. For example, the following command specifies that command rmail uses the default path: 
   COMMANDS=rmail:/usr/lbin/rnews:/usr/bin/lp
The default paths for your computer are /bin, /usr/bin, and /usr/lbin. When the remote machine specifies rnews or /usr/lbin/rnews for the command to be executed, /usr/lbin/rnews is executed regardless of the default path. Similarly, /usr/bin/lp is the lp command that is executed.

Including the ALL value in the list means that any command from the remote computer specified in the entry is executed. If you use this value, you give the remote computer full access to your computer. Be careful, this allows far more access than normal users have.

The following string illustrates two points:

   COMMANDS=/usr/local/bin/lc:ALL:/usr/bin/lp

VALIDATE

is used in conjunction with the COMMANDS option in LOGNAME entries when specifying commands that are potentially dangerous to your computer's security. It provides a certain degree of verification of the caller's identity. The use of the VALIDATE option requires that privileged computers have a unique login or password for UUCP transactions. An important aspect of this validation is that the login or password associated with this entry be protected. If an outsider gets that information, that particular VALIDATE option can no longer be considered secure. (VALIDATE is merely an added level of security to the COMMANDS option, though it is a more secure way to open command access than ALL.)

Careful consideration should be given to providing a remote computer with a privileged login and password for UUCP transactions. Giving a remote computer a special login and password with file access and remote execution capability is like giving anyone on that computer a normal login and password on your computer. Therefore, if you cannot trust someone on the remote computer, do not provide that computer with a privileged login and password. 

The following LOGNAME entry specifies that if one of the remote computers that claims to be eagle, owl, or hawk logs in on your computer, it must have used the login uucpfriend.

   LOGNAME=uucpfriend VALIDATE=eagle:owl:hawk
As can be seen, if an outsider gets the uucpfriend login or password, masquerading is trivial.

VALIDATE increases security by linking the MACHINE entry (and COMMANDS option) with a LOGNAME entry associated with a privileged login. This link is needed because the execution daemon is not running while the remote machine is logged in. In fact, it is an asynchronous process with no knowledge of what machine sent the execution request. How does your system know where the execution files came from?

Each remote computer has its own spool directory on your computer. These spool directories have write permission given only to UUCP programs. The execution files from the remote computer are put in its spool directory after being transferred to your computer. When the uuxqt daemon runs, it can use the spool directory name to find the MACHINE entry in the Permissions file and get the COMMANDS list. If the computer name does not appear in the Permissions file, the default list is used.

The following example shows the relationship between the MACHINE and LOGNAME entries:

   MACHINE=eagle:owl:hawk REQUEST=yes \
   COMMANDS=rmail:/usr/local/bin/lc \
   READ=/  WRITE=/

LOGNAME=uucpz VALIDATE=eagle:owl:hawk \ REQUEST=yes SENDFILES=yes \ READ=/ WRITE=/

The COMMANDS option line shows that remote mail and /usr/local/bin/lc can be executed by remote users. 

In the MACHINE entry, you must make the assumption that when you want to call one of the computers listed, you are really calling eagle, owl, or hawk. Any files put into one of the eagle, owl, or hawk spool directories is put there by one of those computers. If a remote computer logs in and says that it is one of these three computers, its execution files are also put in the privileged spool directory. You should validate that the computer has the privileged login uucpz.

Entries for OTHER systems

You may want to specify different option values for machines or logins that are not mentioned in specific MACHINE or LOGNAME entries. This may occur when there are many computers calling in that have the same set of permissions. The special name OTHER for the computer name can be used in a MACHINE or LOGNAME entry as follows: 
   MACHINE=OTHER \
   COMMANDS=rmail:/usr/local/bin/lc

LOGNAME=OTHER \ REQUEST=yes SENDFILES=yes \ READ=/usr/spool/uucppublic \ WRITE=/usr/spool/uucppublic

All options that can be set for specific machines or logins can be used with the OTHER value, although the use of the VALIDATE option makes little sense.

Combining MACHINE and LOGNAME entries

It is possible to combine MACHINE and LOGNAME entries into a single entry where the common options are the same. For example, the following two entries share the same REQUEST, READ, and WRITE options:
   MACHINE=eagle:owl:hawk REQUEST=yes \
     READ=/  WRITE=/

LOGNAME=uucpz REQUEST=yes SENDFILES=yes \ READ=/ WRITE=/

These two entries can be merged as follows:
   MACHINE=eagle:owl:hawk REQUEST=yes \
   LOGNAME=uucpz SENDFILES=yes \
     READ=/  WRITE=/

How UUCP works

The UNIX system uses the HoneyDanBer implementation of UUCP. UUCP uses a batch method to manage communications traffic, storing (or ``spooling'') requests for later execution when actual contact is made between systems. When UUCP commands are executed, work files and any data files needed are created in /usr/spool/uucp and its subdirectories; these work and data files are described in ``The UUCP spool directory contents''. The program uucico scans these directories for the instructions contained in any work files and executes them. Although it is possible to execute commands immediately, most systems call other systems according to a daily schedule (usually during the evenings to reduce connection costs). There are three directories associated with UUCP:

/usr/spool/uucp
This is the working directory for UUCP. Work files, lock files, log files, and all UUCP communications traffic are stored here and in subdirectories. 

/usr/spool/uucppublic
This is the publicly readable or writable target directory used for most file transfers. A tilde () can be used as an abbreviation for this directory in uucp commands (in csh it must be escaped: \). 

/usr/lib/uucp
Most of the UUCP programs are stored here, as well as the supporting database or control files. The main user programs, including uux and uucp, are found in /usr/bin. 
The /usr/lib/uucp directory also contains configuration files for UUCP (distinguished by their capitalized names). The most important to understand are:

Configuration
contains information that establishes and configures the protocol used when transferring data to and from a remote computer. (This file is optional.)

Systems
contains information needed to establish a link to a remote computer, including the name of the connecting device associated with the remote computer, when the computer can be reached, telephone number, login sequence, and password. 

Permissions
defines the access level granted to computers when they attempt to transfer files or remotely execute commands on your computer.

Devices
contains information concerning the port name, speed, and type of the Automatic Call Units (modems), direct links, and network devices.


The uucp traffic is managed by three daemons (supervisory programs) which run in the background, handling file transfers and command executions. (The daemons can also be executed manually as commands.)

uucico
selects the device used for the link, establishes the link to the remote computer, performs the required login sequence and permission checks, transfers data and executes files, logs results, and (if requested) notifies the user by mail of transfer completions. When the local uucico daemon calls a remote computer, it ``talks'' to the uucico daemon on the remote computer during the session.

uuxqt
performs remote program execution. uuxqt runs after the conversation between the uucico programs is completed. It searches the spool directory for execute files (X.files) that were sent from a remote computer. When an X.file file is found, uuxqt opens it to get the list of data files that are required for the execution. It then checks to see if the required data files are available and accessible. uuxqt also verifies that it has permission to execute the requested command.

uusched
schedules the queued work in the spool directory. Before starting the uucico daemon, uusched randomizes the order in which remote computers are called.

When you enter a UUCP command, the program creates a work file and (usually) a data file for the requested transfer. The work file contains information required for transferring the file. The data file is a copy of the specified source file. After these files are created in the spool directory, the uucico daemon is started.

The uucico daemon attempts to establish a connection to the remote computer. See ``A sample UUCP transaction'' for an example of a session.

When uucico logs in on the remote computer, the remote computer starts a uucico daemon. The two uucico daemons then negotiate the line protocol to be used in the file transfer. The local uucico daemon then transfers the file that you are sending to the remote computer. The remote uucico places the file in the specified pathname on the remote computer. After your local computer finishes sending files, the remote computer may take over and send queued files to your local computer.

If the remote computer or the device selected to make the connection to the remote computer is unavailable, the request remains queued in the spool directory. If set up to run by cron each hour, uudemon.hour starts the uusched daemon. When the uusched daemon starts, it searches the spool directory for the remaining work files, generates the random order in which these requests are to be processed, and then starts the transfer process (uucico) described in the previous paragraphs. 

A sample UUCP transaction

The following steps trace the execution of a uucp command: 

  1. A user on a system called Kilgore wishes to send a copy of the file minutes.01.10 to a remote system called obie. To accomplish this, the user enters the following command:

    uucp minutes.01.10 obie\!/usr/spool/uucppublic

    Note that obie\!\ would also work for the destination and the exclamation point need only be escaped (preceded by a ``\'') if the csh is used; the Bourne shell (sh) and Korn shell (ksh) do not require this.

  2. A work file named C.obieNxxxx is created in the /usr/spool/uucp/obie directory, where xxxx is the job number. 

  3. The uusched daemon schedules the request for execution by uucico. 

  4. When the execution time is reached, uucico first checks the Systems file and confirms that obie is a recognized system and that a call is permitted at this time.

  5. Using the information in the Systems file, uucico next locates the modem device and tty port associated with it as stored in the Devices file. 

  6. Using the phone number in the Systems file and the modem type from the Devices file, uucico uses the appropriate modem commands from the Dialers file (or runs a dialer program from the /usr/lib/uucp directory) to connect to the remote system.

  7. uucico creates a lock file (LCK..tty1a) to lock the serial line, and a lock file (LCK..obie) to lock the called system in the directory /usr/spool/uucp. 

  8. uucico uses the login sequence and password defined in the Systems file to log in to obie, whose own uucico confirms that kilgore is recognized before beginning the actual transaction. 

  9. The calling system, kilgore, is said to be the ``guest''; the called system, obie, is said be the ``host''. The host uucico checks the local Permissions file to confirm that the guest is authorized to transfer the file. 

  10. The guest (kilgore) transmits the file in packets that are checked for errors and retransmitted if garbled. During reception, the file is stored in a temporary file (TM.xxxx) in the /usr/spool/uucp/kilgore directory on the host (obie). When the transfer is complete, the file is moved to the proper destination, in this case /usr/spool/uucppublic/minutes.01.10.

  11. Each machine records its side of the transaction in log files. For example, obie would have recorded the exchange in /usr/spool/uucp/.Log/uucp/kilgore. 

  12. Unless the host system (obie) has requests of its own, a hangup request is sent, the connection is terminated, and the lock files are removed.
For remote command execution (using uux), an execute X.file is created in the /usr/spool/uucp directory. The uuxqt daemon scans this directory for work, checks the Permissions file to confirm permission to execute the command, then executes it. This takes place after the modems hang up and uucico exits. 

How a UUCP transmission proceeds

A UUCP session consists of four parts: connection, an initial handshake that establishes the protocol to use, a series of file transfers, and a final handshake. All four parts produce different characteristic debugging output, and it is possible to deduce which element of the session is failing by scrutinizing the output.

When the connection stage begins, uucico scans the Systems file for the system to connect to. Using the device field for the specified system, it opens the Devices file and connects to the named device.

A single example session is documented in the following sections.

Stage 1: Connection

The command to invoke this session is uutry -x9 scolon, which sets the debugging level to 9 and makes uutry attempt to connect to system scolon. The beginning of the output shows uucico reading the Systems and Devices files in an attempt to set up a connection:

   01: mchFind called (scolon)
   02: list (rmail) num = 1
   03: name (scolon) not found; return FAIL
   04: list (rmail) num = 1
   05: name (OTHER) not found; return FAIL
   06: _Request (FALSE), _Switch (TRUE), _CallBack (FALSE), _MyName (), _Commands rmail
   07: chdir(/usr/spool/uucp/scolon)
   08: conn(scolon)
   09: Device Type ACU wanted
   10: mlock tty1A succeeded
   11: fixline(6, 2400)
   12: processdev: calling setdevcfg(uucico, ACU)
   13: gdial(hayes2400) called

Line 01 indicates that uucico is looking for scolon in Systems. The next six lines are internal debugging information from uucico: on line 08 it finds scolon and attempts to connect to it. From the Systems file uucico determines that it needs a device of type ACU. Checking the Devices file, uucico determines that tty1A is such a device (line 10) and takes it over (line 11), setting it to the speed stated in Devices.

Having obtained a suitable device, uucico invokes the dialer hayes2400 to place the call (line 13), and enters the connection script:

   14: expect: ("")
   15: got it
   16: sendthem (ATQ0E0T&D2&C1S0=0X4S2=043^M)
   17: expect: (OK^M)
   18: ^M^JOK^Mgot it
   19: sendthem (ATDT9222681^M)
   20: expect: (Speed)
   21: ^J^M^JCONNECT 2400got it
   22: getto ret 6
   23: expect: ("")
   24: got it
   25: sendthem (^M^M)
   26: expect: (ogin:)
   27: le /usr/spool/uucppublic/info contains a roadmap of ^J^Mthe bulletin board
   areas.^J^M^J^MWARNING: Unauthorized access will be prosecuted.^J^M^J^M^M^Jscolo
   n!login:got it
   28: sendthem (uusls^M)
   29: expect: (ssword:)
   30: ic/info contains a roadmap of ^J^Mthe bulletin board areas.^J^M^J^MWARNING:
   Unauthorized access will be prosecuted.^J^M^J^M^M^Jscolon!login: uusls^M^JPass
   word:got it
   31: sendthem (bbsuucp^M)
   32: ISTRIP cleared

First the dialer talks to the modem. The standard Hayes modem response to a successful command is to echo OK; line 16 shows the dialer sending an initialization string (specified in /usr/lib/uucp/Dialcodes, or programmed into the dialer binary) to the modem. (A Hayes ATDT command causes the modem to tone-dial the following number.) When the modem establishes a connection, the dialer waits for the modem to return the connection speed: in this case the standard message CONNECT 2400 indicating a 2400-baud link. (Faster modems may return CONNECT 9600 or CONNECT 14400.)

At this point, the dialer follows the login script given in Systems:

   scolon Any  ACU 2400-9600 0923 222681 "" \r ogin:-@-ogin:-@-ogin: uusls ssword:
   bbsuucp
First, a return is sent. Then, uucico waits for the string "ogin". This is received, and uucico sends "uusls", the appropriate login. (The remote host prints the text of /etc/issue, a message file used for remote logins. uucico ignores the message.) Finally, uucico sees the password prompt, sends a password, and clears the login sequence.

If you run a sample uutry session and encounter problems during this phase, then it is probably due to one of the following conditions:


Stage 2: Initial handshake

Now that the dialer has established a connection, the uucico daemon on the local host starts to negotiate a protocol with the remote uucico.

The ^J^M character pairs appearing in the uutry output are carriage return and line feed pairs. In DOS, both characters are needed to indicate the end of a line: in the Macintosh system a ``^M'' indicates the end of a line: and in the UNIX system a ``^J'' indicates the end of a line. Many online services transmit both characters at the end of every line, in case a different type of system tries to connect and cannot recognize the local newline format. When reading the uutry output, a ^M^J character pair should therefore be taken as indicating a new line.

omsg in the uucico debugging output means that the local uucico outputs a message: imsg means that the local uucico reads a message.

uucico ignores the incoming text until it sees a ``^P'' (byte with octal value \020). All messages in the initial handshake begin with a ``^P'' and end with a null byte (represented in this listing as ``^@'').

The first packet is ^PShere=scolon^@. The Shere= message indicates the remote uucico is running on scolon.

Here is the protocol negotiation phase:

   CB + "protocol"
   33 : imsg >^M^JLast   successful login for uusls: Wed Aug 11 14:28:58 BST 1993
   on tty8C^M^JLast unsuccessful login for uusls: Tue Aug 10 19:41:17 BST 199ik3
   on tty8D^M^JSCO UNIX System V/386 Release 3.2^M^JCopyright (C) 1976-1989 UNIX
   System Laboratories, Inc.^M^JCopyright (C) 1980-1989 Microsoft Corporation^M^J
   Copyright (C) 1983-1996 The Santa Cruz Operation, Inc.^M^J All Rights Reserved
   ^M^Jscolon^M^J^PShere=scolon^@Login Successful: System=scolon
   34 : omsg "Sjocksco -Q0 -x9"
   35 : imsg >^PROK^@msg-ROK
   36 :  Rmtname scolon, Role MASTER,  Ifn - 6, Loginuser - root
   37 : rmesg - 'P' imsg >^PPgetxf^@got Pgetxf
   38 : wmesg 'U'g
   39 : omsg "Ug"
   40 : 	Protocol: g
   41 : 		g window size set to 7
   42 : 		g variable packets set to true
   43 : 		g packet size set to 64
   44 : 	Protocol: G
   45 : 		G window size set to 7
   46 : 		G packet size set to 512
After receiving the first packet, ^PShere=scolon^@, the originating host replies with an outgoing message:
   34 : omsg "Sjocksco -Q0 -x9"
The second message packet in any transaction is:
   ^PShostname -Qseqnum -xdebug^@
where hostname is the local hosts name, seqnum is the sequence number for this conversation, and debug is the debugging level in use.

The sequence number is stored at both sites, and is incremented each time a conversation takes place via UUCP. If they do not match up, it is likely that security has been broken (or a disk backup restored following a crash). This feature is not used by all UUCP implementations.

The third packet is an acknowledgement from the remote uucico (which sends ROK -- see below.) A number of different responses are possible at this stage; these may indicate various error conditions:

ROK
The calling UUCP is accepted; proceed to protocol negotiation.

RLCK
The called UUCP already has a lock file for the calling UUCP; the two machines are already communicating (or a lock file has not been removed).

RCB
The called UUCP will call back. (Used to avoid imposters.)

RBADSEQ
The call sequence number is wrong.

RLOGIN
The calling UUCP is using the wrong login.

Ryou are unknown to me
The calling UUCP is not listed in the recipient's Systems file, and the receiving system is not set up to accept anonymous UUCP connections.
If the connection is accepted, the remote system then sends a packet like ^PPgetxf^@. The ``P'' prefix indicates that the subsequent letters are the protocols supported by the remote system. In this case, the ``g'', ``e'', ``t'', ``x'', and ``f'' protocols are supported, in decreasing order of preference.

The local uucico reads /usr/lib/uucp/Configuration to obtain its own protocol setup, and sends a packet in response:

   38 : wmesg 'U'g
to indicate the protocol (in this case, ``g'') to be used. (uucico uses the first protocol it finds listed against the appropriate system or device in Configuration that it has in common with the protocols listed in the remote uucico's protocol string.)

The protocol is then established, and the rest of the UUCP debugging session consists of transfers.

Stage 3: File transfers

The debugging output from the file transfer stage is heavily dependent on the protocol being used to control the transfers. See ``Defining a communications protocol'' for a brief introduction to the protocols.

At all times during a session, one uucico daemon acts as a master, issuing commands, while the other is a slave, obeying orders. Initially, the calling UUCP is master, although the roles may change during the session. If a protocol error occurs while commands are being exchanged, both uucico's switch immediately to the final handshake.

The following commands can be sent by a master:

H
A request to hang up the connection. The slave responds with one of:

HY
The slave agrees to hang up.

HN
The slave disagrees. Master and slave exchange roles, and the new master may begin to issue commands.

R
A request by the master to receive a file from the slave. (Additional arguments are possible.)

S
A request by the master to send a file to the slave. (Additional arguments are possible.)

X
A request by the master to execute uucp on the slave. This command requires additional arguments. It is used when forwarding a file through intermediate hosts.

In the listing below, line 59 indicates that the ``g'' protocol is started (lines 47 to 58 are the internal ``g'' protocol startup sequence). No files are queued for transfer on either host, so after a brief exchange the master issues an HY command on line 76 (which is seen being sent on line 79), and the UUCP session moves to the closing handshake.
   47 :	send 77
   48 :	pkgetpack: Connodata=1
   49 :	rec h->cntl 73
   50 :	send 61
   51 :	state - [INIT code a] (1)
   52 :	pkgetpack: Connodata=2
   53 :	rec h->cntl 61
   54 :	send 57
   55 :	state - [INIT code a]&[INIT code b] (3)
   56 :	pkgetpack: Connodata=3
   57 :	rec h->cntl 53
   58 :	state - [O.K.] (10)
   59 :	Proto started g
   60 :	*** TOP ***  -  role=1, setline - X
   61 :	gtwvec: dir /usr/spool/uucp/scolon
   62 :	wmesg 'H'
   63 :	pkwrite: icount = 64
   64 :	send 37777777610
   65 :	send 64 byte packet.
   66 :	rmesg - 'H' pkgetpack: Connodata=4
   67 :	rec h->cntl 41
   68 :	pkcntl: RR/RJ: Connodata=0
   69 :	state - [O.K.] (10)
   70 :	pkgetpack: Connodata=1
   71 :	rec h->cntl 37777777611
   72 :	send 41
   73 :	got HY
   74 :	 PROCESS: msg - HY
   75 :	HUP:
   76 :	wmesg 'H'Y
   77 :	pkwrite: icount = 64
   78 :	send 37777777621
   79 :	send 64 byte packet.
   80 :	send 10
   81 :	send 10
Stage 4: Closing handshake

The closing handshake is used to confirm that the UUCP session has completed successfully. The calling uucico sends a packet of six zeros, and the remote host responds with a packet of seven zeros. (Line 86 is just a series of trailing nulls appended to the final response packet.)

   82 :	cntrl - 0
   83 :	omsg "OOOOOO"
   84 :	send OO 0,omsg "OOOOOO"
   85 :	imsg >^P^I^H*"^I^P^B!l^R]HY^@omsg "OOOOOO"
   86 :	imsg
   >^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
   ^@^@^@^@^@^@^@^@^@^@exit code 0
   87 :	Conversation Complete: Status SUCCEEDED
   88 :	
   89 :	TM_cnt: 0

Different protocol debugging outputs

Different protocols produce different debugging output during the file transfer phase. The output in the preceding example uses the ``g'' protocol. The ``G'' protocol produces largely similar output, while the non-error correcting protocols (``e'', ``f'', ``x'') produce different output.

In general, the debugging output from uucico once a protocol has been negotiated consists of a list of packets sent, and any errors or resend attempts made. The ``g'' and ``G'' protocols are particularly verbose: the other protocols tend to be less informative.

Advanced UUCP configuration

This section contains several options that are used only in special circumstances and can be ignored in most cases:

Defining a communications protocol

You can define the protocol to use with each device. In most cases it is not needed since you can use the default or define the protocol with the particular system you are calling (For more information on defining the protocol, see the Systems file ``type'' field.) To specify the protocol, use the form type,protocol (for example, ACU, g).

Alternatively, you can set up a Configuration file for your system. This file (/usr/lib/uucp/Configuration) contains the protocol configuration information used for contacting a specific system, or for use with a given device. You can specify different protocols in order of preference, and uucico will negotiate with the daemon at the other end of the session for the first protocol they have in common. In addition, the `g' and `G' protocols have configurable options. These are discussed in detail in the Configuration(F) manual page.

Table 7-2 UUCP communications protocols

 ---------------------------------------------------
 Protocol   Description
 ---------------------------------------------------
    g       standard UUCP protocol for connection
            over serial lines and modems. Uses error
            correction, provides variable packet and
            window size support and dynamic packet
            size adjustment.
    G       variant on ``g'' protocol used by SVR4
            systems.  Provides variable packet and
            window size support. (This is disabled
            on some old fashioned ``g'' protocol
            implementations.)
    e       protocol for 8-bit error-free links
            (example: TCP, TLI, TLIS).  No error
            correction.
    t       protocol for 8-bit error-free links
            (example: TCP, TLI, TLIS).  Checks
            received file size.  This protocol is
            provided for compatibility with BSD-
            derived systems.
    f       protocol for 7-bit only error-free links
            (for example, some X.25 PADs). Does a
            checksum on the entire file.
    x       protocol for 8-bit X.25 error-free
            links. Does not work on some X.25 packet
            switched networks (see t protocol).


NOTE: Changing the uucico window parameter for the ``g'' protocol can cause compatibility problems. Although the ``g'' protocol definition allows different window sizes, some implementations have a compiled-in size of 3 packets. If the local uucico is configured to use a different window size, the remote uucico daemon may die if it has a compiled-in limit. For example, it is best not to modify the default values if you plan on connecting to UUNET. See the Configuration(F) manual page for a full discussion of issues surrounding protocol packet and window sizes, and ``How a UUCP transmission proceeds'' for a demonstration of the debugging output from a ``g'' protocol session.

Creating a portable UUCP Systems file

The Dialcodes file (/usr/lib/uucp/Dialcodes) contains the dial-code abbreviations that can be used in the ``Phone'' field of the Systems file. This feature is intended primarily for those who wish to create a standard Systems file for distribution among several sites that have different phone systems and area codes. As such, the Dialcodes file is probably not necessary for most sites. See the dialcodes(F) manual page for more information, and ``How UUCP works'' for general background on how the Dialcodes file is used.

Specifying alternate UUCP configuration files

The /usr/lib/uucp/Sysfiles file lets you assign different files to be used by uucp and cu as Systems, Devices, and Dialers files. This feature s useful for cases where UUCP and cu require different dialers. See the sysfiles(F) manual page for more information.

Preventing unknown sites from logging in

The script remote.unknown is executed when a site whose name does not appear in your Systems file dials into your system. It logs the conversation attempt and fails to make a connection. If you wish to allow such ``unknown'' systems to log in to your system, you can change the permissions of this file so it cannot execute and your system accepts any communication requests. To do so, enter the following commands while logged in as root:

cd /usr/lib/uucp
chmod 000 remote.unknown

Configuring UUCP for 7-bit systems

Most UUCP systems use 8 data bits, one stop bit, and no parity for communicating over serial links. However, some implementations use 7 data bits, one stop bit, and one parity bit. Parity may be even, odd, or ignored.

To permit outgoing UUCP connections to a 7-bit system, you must modify the Systems file entry for that system. Two special keywords are recognized: PEVEN and PODD. PEVEN means even parity is to be used; PODD means odd parity is to be used. If both are specified, no parity is used. For example:

7-bit even:

   remote Any ACU 2400 4253502 PEVEN -\r\d-ogin:-\K\d-ogin:-\K\d-ogin: uusys
7-bit odd:
   remote Any ACU 2400 4253502 PODD -\r\d-ogin:-\K\d-ogin:-\K\d-ogin: uusys
7-bit none:
   remote Any ACU 2400 4253502 PEVEN PODD -\r\d-ogin:-\K\d-ogin:-\K\d-ogin: uusys
To receive incoming calls from a 7-bit system, specify an appropriate /etc/gettydefs entry in the /etc/inittab entry for the modem port. As no 7-bit configurations are provided, you will need to add one. Be sure to leave blank lines above and below the new entry. For full details of a gettydefs entry, see the gettydefs(F) manual page.

The /etc/gettydefs file recognizes three special keywords:

PARENB
use even parity

PARODD
use odd parity

IGNPAR
ignore parity
For example, assuming an incoming call is expected on tty1A, the following changes should be made to /etc/inittab and /etc/gettydefs:

7-bit even:

/etc/inittab

Se1A:2:respawn:/etc/getty -t60 tty1A 24E

/etc/gettydefs

24E#B2400HUPCL#B2400CS7PARENBHUPCLTAB3ECHOEIXANY#\r\n@!login:#24E

7-bit odd:

/etc/inittab

Se1A:2:respawn:/etc/getty -t60 tty1A 240

/etc/gettydefs

24O#B2400HUPCL#B2400CS7PARODDHUPCLTAB3ECHOEIXANY#\r\n@!login:#24O

7-bit none:

/etc/inittab

Se1A:2:respawn:/etc/getty -t60 tty1A 2DN

/etc/gettydefs

24N#B2400HUPCL#B2400CS7IGNPARHUPCLTAB3ECHOEIXANY#\r\n@!login:#24N

For more information about parity settings, see the stty(C) manual page.

Connecting two local systems using a direct wire

If you are using UUCP to connect remote machines, you can skip this section. To connect two computers with a direct wire, you need to choose a serial port on each machine, connect a serial wire (RS-232) between the two machines using the chosen serial ports, and edit the UUCP configuration files.

Choosing a serial port
On each machine, choose the RS-232 serial port (/dev/ttynn) you want to use. If there are no ports available, you must install a new serial line or make one available by removing any device connected to it. Before you remove a terminal, make sure no one is logged in on it.

Find the name of the device special file associated with the line. The device name should have the form: 

/dev/ttynn

where nn is the number of the corresponding line. For example, /dev/tty1a usually corresponds to COM1. You need the name of the actual line for later steps. Be sure and use the non-modem control port (for example, /dev/tty1a instead of /dev/tty1A).

The serial port should be owned by uucp. To make sure the line is owned by uucp, enter this command:

chown uucp /dev/ttynn

where nn is the number of the corresponding line.

Connecting a serial cable
Connect two computers together using an RS-232 cable. The actual pin configurations sometimes vary between machines.

The cable should connect pins 2, 3, and 7 on one computer to the same pins on the second computer. Typically, the cable must be nulled, which means that pin 2 on one machine is connected to pin 3 on the other, and 3 to 2. Because the connections can vary, check the hardware manuals for each computer to determine the proper pin connections.

Editing the UUCP configuration files
You should edit the UUCP files as instructed in ``Configuring UUCP'', except you should use the keyword Direct instead of ACU in the Systems files.

Testing a direct wire connection
The following steps will enable you to use the cu command on the local machine to log in to the remote machine.

  1. Enable the port of the remote machine:

    enable /dev/ttynn

    where nn is the serial port you are using.

  2. Disable the port of the local machine:

    disable /dev/ttynn

    where nn is the serial port you are using.

To connect to the remote machine from the local machine, type:

cu -x9 -lttynn dir

where nn is the port of the main machine.

Press the <Bksp> key until the lines are synchronized and you get a login prompt. To log in, you must have an account on the remote machine.

If you do not get a login prompt, read the cu -x9 output for any clues of what could be wrong. See ``Common UUCP error messages''.

Troubleshooting UUCP

Before troubleshooting the UUCP system, make sure that the physical connection works. If you are connecting to UUCP with a modem, verify that the modem is installed and configured correctly. See ``Troubleshooting modems'' in the SCO OpenServer Handbook. If you are using a direct line, make sure that the computers are connected correctly -- use the instructions in ``Connecting two local systems using a direct wire''.


NOTE: If you are configuring an outbound UUCP connection over a modem, cu must function for UUCP to work.

If the hardware is correctly configured but a session is repeatedly failing for no known reason, the first troubleshooting step should be to run uutry and save the output log. The log (stored in /tmp/hostname, where hostname is the remote host's name) contains a listing of the steps uucico went through, and may indicate where the failure occurred.

uucico produces 11 levels of debugging output, from 0 to 10. Level 9 is the most verbose standard mode, and is generated when uucico receives the command line option -x9 (you can also pass this option to uutry when testing the uucico connection to a given site). Level 10 is identical to level 9, except that the output from the ``g'' or ``G'' protocols is written to a file in /tmp for future reference.

See also:

Checking for a faulty ACU or modem

The following are two methods for checking whether the ACU (Automatic Call Unit) or modems are working correctly:

See also ``Troubleshooting modems'' in the SCO OpenServer Handbook.

Errors when testing the connection with cu

This section suggests hot to respond to the messages displayed when testing the connection with the cu command fails. 

Connect failed: CANNOT ACCESS DEVICE

If the connection fails and the system displays the CANNOT ACCESS DEVICE message, check the permissions on the device file. For example, to check the device file for tty1a, enter:

l /dev/tty1a

The ownership and permissions settings should look like the following:

   crw--w--w- 1 uucp  uucp     5, 0 Feb 14 12:00 /dev/tty1a
If, instead, the ownership and permissions for the device file look like this:
   crw------- 1 bin   terminal 5, 0 Feb 14 12:00 /dev/tty1a
verify that the line for the port in the /etc/inittab looks similar to the following:
   t1A:23:respawn:/etc/getty -t60 tty1A 3
If it does not, edit /etc/inittab and /etc/conf/init.d/sio and change the lines for the appropriate port.


NOTE: Because a new inittab file is created each time the kernel is relinked, you must also edit /etc/conf/init.d/sio to retain the changes in inittab.

To make your changes to inittab effective immediately, enter:

telinit q

Connect failed: SYSTEM NOT IN Systems FILE

If the /usr/lib/uucp/Systems file on your computer does not contain an entry for the system that you are trying to access, cu displays this message.


NOTE: This error message is often caused by an illegal character in the phone number, leading cu to treat it as a system name rather than a phone number.

To display a list of all the systems that your system is connected to, enter:

uuname

The system may display this error message if you used the -l option to specify a serial port and you entered the wrong line number. Verify that the line is configured properly.

Connect failed, NO DEVICES AVAILABLE

If cu fails to connect and displays the NO DEVICES AVAILABLE message, check to see that the /usr/lib/uucp/Devices file is set up correctly.

Verify that the line that corresponds to the device that you are using is uncommented. For example, the entry in Devices for a direct line using tty1a at 9600 baud looks like this:

   Direct tty1a - 9600 direct
There should be no leading spaces. If the Device file looks correct, the remote line may be busy. Try again later.

Connected, but no login prompt

If cu displays the Connected message, but not the login prompt, the line for the remote system may be busy. To exit cu, enter . and press <Enter>.

If everything appears to be working on your system but the login prompt for the remote machine does not appear, check with the remote system administrator to verify that the getty on the remote system is set up with the same communications parameters that you are using.

Connected, but screen displays garbage

If you connect to the remote system, but your screen displays garbage, see ``Problems dialing out'' in the SCO OpenServer Handbook for more information. You should confirm that the communication settings on your system match those of the remote system. If the condition persists, the connection may be bad. Exit cu by entering . and try again later.

Common ``UUCP failed'' messages

Errors that UUCP displays immediately after you enter the uucp command are generally syntax or permissions errors, and include either of the following messages: 

   uucp failed completely
   uucp failed partially
Here are some common problems and the error messages that the system displays:

Checking the status of a UUCP request

If the system does not display an error message immediately after entering the uucp command, and the system prompt appears, the uucp request is queued. Use the uustat and uulog utilities to check the status of your uucp job.

Use the uustat command to display the status of the currently queued uucp requests or display the status of connections to other systems. For example, to display a list of all the queued jobs for the user robertm, enter:

uustat -u robertm

The uustat utility displays user status information in the following format:

   couscousN266 01/26-15:43 S couscous robertm rmail edwarda
To list the status of the accessibility of all the remote machines, use the following command:

uustat -m

The following example shows the output from the uustat command:

   scooter 01/26-15:43  CAN'T ACCESS DEVICE
   disco   01/27-12:01  SUCCESSFUL
   obie    01/25-05:12  CALL FAILED, JOB DELETED
For more information on the options to uustat, see the uustat(C) manual page.

The uulog command displays the status messages (most recent last) that the UUCP programs write to the files uucp/sys, uux/sys, uucico/sys, and uuxqt/sys, in the /usr/spool/uucp/.Log directory (sys is the name of the system that uucp is trying to access).

For example, to display status information about file transfers involving the system scooter, enter the following:

uulog -s scooter

The uulog utility displays information about the system in the following format:

   uucp scooter (01/26-15:43:00, 304, 5) COPY (SUCCEEDED)


NOTE: The uulog command displays all the status messages that uucp logs in the .Log files. The messages are not necessarily error messages.

Alarms in UUCP audit output, data is not transferring

When sending data, UUCP expects a certain packet size and checksum on the packet. If it does not receive a full packet in a certain amount of time, a timeout occurs, which generates an alarm. A problem can sometimes occur once UUCP has begun sending data, in that part way through the transfer, alarms are generated and UUCP attempts to resend the packets. There are a couple of possible reasons for this problem.

First, check that mapchan(M) is not being used on the line that uucico is using. If it is, enter:

mapchan -n ttyxx

to turn mapping off for that port. If mapchan is not running on that port, there is probably some kind of line noise or modem problem that is corrupting the data being sent.

Alternatively, the problem may occur if you are using UUCP with MNP 5 or some other error checking protocol that is specific to the modems. Error checking on a modem also sends a certain packet size with a checksum. The problem is that the sending modem waits to get a certain amount of data before it sends the packet, which can cause problems with UUCP because it is also waiting for a packet. The solution is to not use error checking on the modem when using UUCP (UUCP has its own error checking).

Generating log reports on usage: uulog

The uulog program displays log information on UUCP usage according to the remote machine. All usage of the programs uucp, uuto, and uux are logged in special log files, one per machine. 

uulog options

The uulog command has the following options:

-fsystem
displays the last entry or entries of the system file transfer log. 

-ssystem
displays the system file transfer information.

-xsystem
displays the uuxqt log file for the given system. 

-number
specifies the number of lines displayed by the -f option.
For example, to print the last 10 lines of chicago's file-transfer log, you would enter:

uulog -fchicago -10

Special uulog files

During execution of the uulog program, the files from the following directories are examined:

/usr/spool/uucp/.Log/uucico/*

directory used for log files by the uucico program

/usr/spool/uucp/.Log/uuxqt/*

directory used for log files by the uuxqt program 

Common UUCP log and status file messages

UUCP keeps track of activity in log and status files in the /usr/spool/uucp directory. The UUCP programs uucp, uux , uucico , and uuxqt write status information for each system to files in the /usr/spool/uucp/.Log directories. The uucico utility writes messages to the files in the /usr/spool/uucp/.Status directory. These messages describe the status of the transfer request, such as uucico failures, completions, and the time until the next allowable call for each remote system with which you communicate. 

The following sections suggest responses to common error messages that UUCP programs write to these files. 

DEVICE LOCKED

The uucico creates a lock file named LCK..sitename for the remote system in the /usr/spool/uucp directory. If a file for the system that you are trying to call exists, uucico assumes that the device is in use.

To use the device, enter the following command on the remote system, substituting the name of the remote system for sitename:

rm /usr/spool/uucp/LCK.sitename


NOTE: If this does not solve the problem, the modem could be asserting CD (carrier detect) improperly.

LOGIN FAILED

If this error message appears, one of several things may be wrong:

  1. Check the /usr/lib/uucp/Systems file on the local machine to verify that the information in this file, particularly the chat script, is current. Some information that may be out-of-date is the phone number, login, and password.

  2. Verify that the modem setup on both ends is correct. Refer to ``Troubleshooting modems'' in the SCO OpenServer Handbook for more information.

  3. Check the phone connection. Try a different phone line. 
After each step, invoke the uutry command.

NO DEVICES AVAILABLE

If the system displays this message, one of several things may be wrong:

  1. The system assumes that the modem is in use because there is a lock file for it. Enter the following from the local machine:

    rm /usr/spool/uucp/LCK*

  2. There may be no valid device for the calling system to use. Verify that the device named in the /usr/lib/uucp/Systems file corresponds to the entry in /usr/lib/uucp/Devices. 

  3. If the message persists, reboot the system. Enter the rm command again, and then invoke the uutry command again.

  4. If the message persists after rebooting the system, the modem may be configured incorrectly. Verify that you can use cu to call out. Refer to ``Troubleshooting modems'' in the SCO OpenServer Handbook for more information.

REMOTE DOES NOT KNOW ME

If the system displays this message, the /usr/lib/uucp/Systems file on the machine that you are trying to call does not contain an entry for your machine. Check the Systems file on the remote machine.

REMOTE HAS a LCK FILE FOR ME

If your system displays this message, either the remote system is trying to call your system or there is a lock file for your system on the remote system.

  1. Remove the lock file from the remote system by removing the appropriate lock file:

    rm /usr/spool/uucp/LCK.sitename

  2. Invoke the uutry command again.

SYSTEM NOT IN Systems FILE

If the /usr/lib/uucp/Systems file on your system does not contain an entry for the system that you are trying to access, this error message is displayed. Use the uuname command to verify that the system name is in the Systems file.

RETRY TIME NOT REACHED

When UUCP requests fail, retries are not executed immediately. After an attempt to contact a remote system, a status file remains in /usr/spool/uucp/.Status/nodename (nodename is the name of the remote system that you are trying to reach). This file contains information about the last request and does not allow another request until the minimum retry period (specified in the /usr/lib/uucp/Systems file) is reached. If you try to use UUCP again, the system displays an error message like the following:

   RETRY TIME NOT REACHED
To enable another call attempt immediately, remove the status file for the remote system from the /usr/spool/uucp/.Status directory:

rm /usr/spool/uucp/.Status/nodename

CANNOT ACCESS FILE

If the system displays this message, it cannot access the calling device port. Check the permissions and ownership on the device file:

l /dev/ttyxx

Where xx is the tty number. The ownership and permissions settings should look like the following:

   crw-r--r--  1 uucp  uucp  5,  0 Feb  14 12:00 /dev/ttyxx
See ``Connect failed: CANNOT ACCESS DEVICE'' for information on changing the permissions.

WRONG TIME TO CALL

The /usr/lib/uucp/Systems file may restrict outgoing calls at this time.

Common UUCP error messages

This section lists the error messages associated with UUCP. There are two types of error messages. ASSERT errors are recorded in the /usr/spool/uucp/.Admin/errors file. STATUS errors are recorded in individual machine files found in the /usr/spool/uucp/.Status directory. Error messages are also stored in /usr/spool/uucp/.Log/uucico/sysname.

ASSERT error messages

When a process is aborted, ASSERT error messages are recorded in /usr/spool/uucp/.Admin/errors. These messages include the filename, SCCS ID, line number, and text. In most cases, these errors are the result of filesystem problems. Use errno (when present) to investigate the problem. If errno is present in a message, it is shown as ``()'' in this list. 

Table 7-3 ASSERT error messages

 --------------------------------------------------------------
 Error message       Description or action
 --------------------------------------------------------------
 CAN'T OPEN          An open() or fopen() failed.  Check for
                     the presence of the file and incorrect
                     permissions.
 CAN'T WRITE         A write(), fwrite(), fprint(), and so on
                     failed.  Check for the presence of the
                     file and incorrect permissions.
 CAN'T READ          A read(), fgets(), and so on failed.
                     Check for the presence of the file and
                     incorrect permissions.
 CAN'T CREATE        A create() call failed. Check permissions.
 CAN'T ALLOCATE      A dynamic allocation failed.
 CAN'T LOCK          An attempt to make a LCK (lock) file
                     failed.  In some cases, this is a fatal
                     error.
 CAN'T STAT          A stat() call failed.  Check for the
                     presence of the file and incorrect
                     permissions.
 CAN'T CHMOD         A chmod() call failed.  Check for the
                     presence of the file and incorrect
                     permissions.
 CAN'T LINK          A link() call failed.  Check for the
                     presence of the file and incorrect
                     permissions.
 CAN'T CHDIR         A chdir() call failed.  Check for the
                     presence of the file and incorrect
                     permissions.
 CAN'T UNLINK        An unlink() call failed.
 WRONG ROLE          This is an internal logic problem.
 CAN'T MOVE TO       An attempt to move some bad C. or X. files
 CORRUPTDIR          to the /usr/spool/uucp/.Corrupt directory
                     failed.  The directory is probably missing
                     or has wrong modes or owner.
 CAN'T CLOSE         A close() or fclose() call failed.
 FILE EXISTS         The creation of a C. or D. file is
                     attempted, but the file exists.  This
                     occurs when there is a problem with the
                     sequence file access.  Usually indicates a
                     software error.
 No uucp server      A TCP/IP call is attempted, but there is
                     no server for UUCP.
 BAD UID             The uid cannot be found in the /etc/passwd 
                     file.  The filesystem is in trouble, or
                     the /etc/passwd file is inconsistent.
 ULIMIT TOO SMALL    The ulimit for the current user process is
                     too small.  File transfers may fail, so
                     transfer is not attempted.
 BAD LINE            There is a bad line in the Devices file;
                     there are not enough arguments on one or
                     more lines.
 FSTAT FAILED        There is something wrong with the Ethernet
 IN EWRDATA          media.
 SYSLST OVERFLOW     An internal table in gename.c overflowed.
                     A big or strange request was attempted.
 TOO MANY SAVED      Same as previous message.
 C FILES
 RETURN FROM         An ioctl, which should never fail, failed.
 fixline ioctl       There is a system driver problem.
 BAD SPEED           A bad line speed appears in the Devices or
                     Systems file (``Class'' field).
 PERMISSIONS file:   There is a bad line or option in the
 BAD OPTION          Permissions file.
 PKCGET READ         The remote machine probably hung up.  No
                     action need be taken.
 PKXSTART            The remote machine aborted in a non-
                     recoverable way. This can generally be
                     ignored.
 SYSTAT OPEN FAIL    There is a problem with the modes of
                     /usr/lib/uucp/.Status, or there is a file
                     with bad modes in the directory.
 TOO MANY LOCKS      There is an internal problem!
 XMV ERROR           There is a problem with some file or
                     directory.  It is probably the spool
                     directory, because the modes of the
                     destinations were supposed to be checked
                     before this process was attempted.
 CAN'T FORK          An attempt to fork(S) and exec(S) failed.
                     The current job should not be lost, but is
                     attempted later (uuxqt). No action need be
                     taken.


UUCP STATUS error messages

UUCP STATUS error messages are messages that are stored in the /usr/spool/uucp/.Status directory. This directory contains a separate file for each remote machine that your system attempts to communicate with. These individual machine files contain status information on the attempted communication, and whether it was successful or not. A list of the most common error messages that can appear in these files follows.


Table 7-4 STATUS error messages

 --------------------------------------------------------------
 Error message           Description or action
 --------------------------------------------------------------
 OK                      Self explanatory.
 NO DEVICES AVAILABLE    There is currently no device available
                         for the call.  Check to see that there
                         is a valid device in the Devices file
                         for the particular system.  Check the
                         Systems file for the device to be used
                         to call the system.
 WRONG TIME TO CALL      A call was placed to the system at a
                         time other than what is specified in
                         the Systems file.
 TALKING                 Self explanatory.
 LOGIN FAILED            The login for the given machine
                         failed.  It could be a wrong login or
                         password, wrong number, a very slow
                         machine, or failure in getting through
                         the dialer-token script.
 CONVERSATION FAILED     The conversation failed after
                         successful startup.  This usually
                         means that one side went down, the
                         program aborted, or the line (link)
                         was dropped.
 DIAL FAILED             The remote machine never answered. It
                         could be a bad dialer or the wrong
                         phone number.
 BAD LOGIN/MACHINE       The machine called us with a login or
 COMBINATION             machine name that does not agree with
                         the Permissions file.  This could be
                         an attempt to masquerade!
 DEVICE LOCKED           The calling device to be used is
                         currently locked and in use by another
                         process.
 ASSERT ERROR            An ASSERT error occurred.  Check the
                         /usr/spool/uucp/.Admin/errors file for
                         the error message and refer to
                         ``Common UUCP error messages'' 
 SYSTEM NOT IN Systems   The system is not in the Systems file.
 CAN'T ACCESS DEVICE     The device tried does not exist or the
                         modes are wrong.  Check the
                         appropriate entries in the Systems and
                         Devices files.
 DEVICE FAILED           The opening of the device failed.
 WRONG MACHINE NAME      The called machine is reporting a
                         different name than expected.
 CALLBACK REQUIRED       The called machine requires that it
                         calls your system.
 REMOTE HAS A LCK        The remote site has a lock file for
 FILE FOR ME             your system.  They could be trying to
                         call your machine.  If they have an
                         older version of UUCP, the process
                         that was talking to your machine may
                         have failed leaving the lock file.  If
                         they have the new version of UUCP and
                         they are not communicating with your
                         system, then the process that has a
                         lock file is hung.  This can also be
                         caused by incorrect permissions in the
                         /usr/spool/uucp path on the remote
                         system, or cleared uucico SUID bit.
 REMOTE DOES NOT         The remote machine does not have the
 KNOW ME                 node name of your system in its
                         Systems file.
 REMOTE REJECT           The login used by your system to log
 AFTER LOGIN             in does not agree with what the remote
                         machine was expecting.  Check the
                         Permissions file on the remote system.
 REMOTE REJECT,          The remote machine rejected the
 UNKNOWN MESSAGE         communication with your system for an
                         unknown reason.  The remote machine
                         may not be running a standard version
                         of UUCP.
 STARTUP FAILED          Login succeeded, but initial handshake
                         failed.  Check communication
                         parameters: data word size, parity,
                         stop bits, and so on.
 CALLER SCRIPT FAILED    This is usually the same as DIAL
                         FAILED.  However, if it occurs often,
                         suspect the caller script in the
                         Dialers file.  Use uutry to check.

Checking UUCP files and permissions settings

UUCP does not work correctly if it cannot read or execute its files. Because virtually all of the UUCP files are writable only by the superuser, and many of them are also readable and executable only by root and uucp, you should log in as root to install and modify the UUCP system. When you have finished, verify that all of the UUCP files are owned by uucp and not root.

To check the permissions of the UUCP files, use the Software Manager or custom(ADM) as described in ``Verifying software'' in the SCO OpenServer Handbook. Select Expand Fully from the View menu and then select ``UUCP Utilities'' from the list of components. Then select Verify Software from the Software menu. This verifies the UUCP distribution files and fixes any incorrect permissions.

Use the uucheck(ADM) command to check for the presence of the required files and directories.


NOTE: The Systems and Permissions files contain unencrypted passwords, and therefore should be readable only by uucp (and root).

Verifying that your site name is unique

Make sure that the first seven characters of your sitename name are unique. If your machine is connected directly to a machine with the same sitename, UUCP does not allow communication with that machine. If both your machine and another machine with the same name are not directly connected, but are on the same UUCP network, electronic mail may go to the wrong machine.

To check the sitename use the uname(C) command. To change the sitename, see ``Changing the system name'' in the Mail and Messaging Guide.

UUCP truncates system names to seven characters

By default, UUCP truncates system names to seven characters to ensure compatibility with all versions of UUCP. Although disabling this feature is not recommended, it can be done.

In the file /usr/lib/uucp/Permissions, add the variable MYNAME=name to each entry in this file, where name is the actual system name that contains more than seven characters. Also, add a new entry in /usr/lib/uucp/Permissions as follows:

   MACHINE=OTHER \
   READ=/usr/spool/uucppublic:/usr/tmp \
   WRITE=/usr/spool/uucpppublic:/usr/tmp \
   COMMANDS=rmail:rnews:uucp \
   SENDFILES=yes REQUEST=yes \
   MYNAME=name
where name is the actual system name.

The MYNAME variable supersedes the truncated name. This procedure should be done on every machine in the UUCP network that has a name more than seven characters long.


NOTE: MYNAME affects only those systems calling into the system with a Permissions file that has been modified as described here. Calling out to a system with a system name longer than seven characters results in that system name being truncated to seven characters. This is only a problem if your system calls systems with names which are identical through the seventh character.

What to check if UUCP is abnormally slow

Because UUCP is a batching network, requests are not executed immediately. Therefore, when users report that UUCP does not work, the problem may be that the system is slow. If the system is slower than usual, check for the following problems:

  1. Check the spool directories, /usr/spool/uucppublic and /usr/spool/uucp for an overload of old work files and remove them.

  2. Use ps(C) to verify that there are not too many uucico processes going at once. The limit to the number of communications processes is specified in /usr/lib/uucp/Maxuuscheds and /usr/lib/uucp/Maxuuxqts. Check to see that the limit is not too high (the default is 1).

  3. Make sure that the filesystem that contains the spool directory is not out of space. Refer to ``Maintaining free space in filesystems'' for more information.

  4. The /usr/lib/uucp/uudemon.clean script performs general cleanup by removing old files that are trying unsuccessfully to execute. To change the frequency of the cleanings, edit the find statement in the uudemon.clean script.

What to do if UUCP works, but uux does not

If you can use uucp to transfer files between two systems, but you cannot use uux, there is a problem with the /usr/lib/uucp/Permissions file. When you use the uucp utility, the remote system requires only the LOGNAME entry in Permissions; uux also requires the MACHINE entry.

To fix this problem, add the MACHINE entry with the name of the remote system, to Permissions. For example, if your local machine, goanna is set up to call obie, the entry for goanna in the Permissions file on obie should look like this:

   LOGNAME=uugoanna MACHINE=goanna \
           COMMANDS=ALL \
           READ=/ \
           WRITE=/ \
           SENDFILES=yes REQUEST=yes


NOTE: The permissions granted in the example above are very liberal and should only be used in closely coupled systems where there is no security risk.

UUCP troubleshooting utilities

There are several commands you can use to check for basic communications information.

Table 7-5 UUCP troubleshooting tools

 -----------------------------------------------------------------
 Command   Description
 -----------------------------------------------------------------
 uucheck   Checks for the presence of files and directories
           required by uucp. This command also checks the
           Permissions file for obvious errors.
 uulog     Displays the contents of the log directories for
           specific hosts.
 uuname    Lists the machines that you are set up to contact.
 uustat    Displays the status of the currently queued uucp 
           requests or connections to other systems.
 uutry     Invokes uucico with debugging, saves the information to
           the file /tmp/machine, and directs the last 10 lines of
           the output to the terminal. The -x option changes the
           debugging level (default is level 5).

The UUCP spool directory contents

The following describes all files and subdirectories of the UUCP spool directory. These files are created in spool directories to lock devices, hold temporary data, or keep information about remote transfers or executions.

TM. (temporary data file)

These data files are created by UUCP processes under the spool directory (that is, /usr/spool/uucp/system) when a file is received from another computer. The system directory has the same name as the remote computer that is sending the file. The names of the temporary data files have the format: 

TM.pid.ddd

where pid is a process-ID and ddd is a sequential three-digit number starting at 0.

When the entire file is received, the TM.pid.ddd file is moved to the pathname specified in the C.sysnxxxx file (discussed below) that caused the transmission. If processing is abnormally terminated, the TM.pid.ddd file may remain in the system directory. These files should be automatically removed by uuclean.

LCK. (lock file)

Lock files are created in the /usr/spool/uucp directory for each device in use. Lock files prevent duplicate conversations and multiple attempts to use the same calling device. The names of lock files have the format:

LCK..str

where str is either a device or computer name. These files may remain in the spool directory if the communications link is unexpectedly dropped (usually on computer crashes). The lock files are ignored (removed) after the parent process is no longer active. The lock file contains the process ID of the process that created the lock. The lock file is always named by converting the last letter to lowercase (meaning non-modem control) to avoid possible conflicts if the same line is specified both as modem-control and non-modem-control. For example, the lock on /dev/tty1A is named LCK..tty1a. 

C. (work file)

Work files are created in a spool directory on the local computer when work (file transfer or remote command execution) is queued for a remote computer. The names of work files have the format:

C.sysnxxxx

where sys is the name of the remote computer, n is the ASCII character representing the grade (priority) of the work, and xxxx is the four-digit job sequence number assigned by UUCP. Work files contain the following information:

D.(data file) 

Data files are created in the spool directory on both the local and remote computers when it is specified in the command line to copy the source file to the spool directory. The names of data files have the following format:

D.systmxxxxyyy

where systm is the first five characters in the name of the remote computer, xxxx is a four-digit job sequence number assigned by uucp. The four-digit job sequence number may be followed by a subsequence number yyy which is used when there are several D. files created for a work (C.) file.

X. (execute file)

Execute files are created in the spool directory on the remote computer prior to remote command executions. The names of execute files have the following format:

X.sysnxxxx

where sys is the name of the remote computer, n is the character representing the grade (priority) of the work, and xxxx is a four-digit sequence number assigned by UUCP. Execute files contain the following information: