Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lpd(ADMN) — TCP/IP 1.2.0.i

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lp(C)

lpstat(C)

cancel(C)

syslog(SLIB)

printcap(SFF)


 lpd(ADMN)                       19 June 1992                       lpd(ADMN)


 Name

    lpd - line printer daemon

 Syntax

    /usr/lib/lpd [ -l ] [ port # ]

 Description

    lpd is the line printer daemon (spool area handler) and is normally
    invoked at boot time from the rc2(ADM) file.  It makes a single pass
    through the printcap(SFF) file to find out about the existing printers
    and prints any files left after a crash. It then uses the system calls
    listen(SSC) and accept(SSC) to receive requests to print files in the
    queue, transfer files to the spooling area, display the queue, or remove
    jobs from the queue.  In each case, it forks a child to handle the
    request so the parent can continue to listen for more requests.  The
    Internet port number used to rendezvous with other processes is normally
    obtained with getservbyname(SLIB) but can be changed with the port #
    argument.  The -l flag causes lpd to log valid requests received from the
    network. This can be useful for debugging purposes.

    Access control is provided by two means. First, all requests must come
    from one of the machines listed in the file /etc/hosts.equiv or
    /etc/hosts.lpd.  Second, if the ``rs'' capability is specified in the
    printcap entry for the printer being accessed, lp requests will only be
    honored for those users with accounts on the machine with the printer.

    The file minfree in each spool directory contains the number of disk
    blocks to leave free so that the line printer queue won't completely fill
    the disk.  The minfree file can be edited with your favorite text editor.

    The file lock in each spool directory prevents multiple daemons from
    becoming active simultaneously, and to store information about the daemon
    process for lp(C), lpstat(C), and cancel(C).  After the daemon has suc-
    cessfully set the lock, it scans the directory for files beginning with
    cf.  Lines in each cf file specify files to be printed or non-printing
    actions to be performed.  Each such line begins with a key character to
    specify what to do with the remainder of the line.

    J    Job Name.  String to be used for the job name on the burst page.

    C    Classification.  String to be used for the classification line on
         the burst page.

    L    Literal.  The line contains identification info from the password
         file and causes the banner page to be printed.

    T    Title.  String to be used as the title for pr(C).

    H    Host Name.  Name of the machine where lp was invoked.

    P    Person.  Login name of the person who invoked lp.  This is used to
         verify ownership by cancel.

    M    Mail. Send mail to the specified user when the current print job
         completes.

    f    Formatted File.  Name of a file to print which is already formatted.

    r    Request ID.  The request ID is used by the cancel(C) command.

    U    Unlink.  Name of file to remove upon completion of printing.

    If a file can not be opened, a message will be logged via syslog(SLIB)
    using the LOGLPR facility.  lpd will try up to 20 times to reopen a file
    it expects to be there, after which it will skip the file to be printed.

    lpd uses fcntl(S) to provide exclusive access to the lock file and to
    prevent multiple deamons from becoming active simultaneously.  If the
    daemon should be killed or die unexpectedly, the lock file need not be
    removed.  The lock file is kept in a readable ASCII form and contains two
    lines.  The first is the process ID of the daemon and the second is the
    control filename of the current job being printed.  The second line is
    updated to reflect the current status of lpd for the programs lpstat(C)
    and cancel(C).

 Files

    /etc/printcap            printer description file
    /usr/spool/*             spool directories
    /usr/spool/*/minfree     minimum free space to leave
    /dev/lp*                 line printer devices
    /etc/hosts.equiv         lists machine names allowed printer access
    /etc/hosts.lpd           lists machine names allowed printer access,
                             but not under same administrative control.

 See also

    lp(C), lpstat(C), cancel(C), syslog(SLIB), printcap(SFF)


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026