up | Inhaltsverzeichniss | Kommentar

Manual page for LPD(8)

lpd - printer daemon


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


lpd is the line printer daemon (spool area handler). It is usually invoked at boot time from the rc.8 script, making a single pass through the printcap.5 file to find out about the existing printers and printing any files left after a crash. It then accepts requests to print files in a queue, transfer files to a spooling area, display a queue's status, or remove jobs from a queue. In each case, it forks a child process for each request, and continues to listen for subsequent requests.

The Internet port number used to communicate with other processes is usually obtained with getservent.3n but can be specified with the port# argument.

If a file cannot be opened, an error message is logged using the LOG_LPR facility of syslog.3 lpd will try up to 20 times to reopen a file it expects to be there, after which it proceeds to the next file or job.


Log valid requests received from the network. This can be useful for debugging purposes.
-L logfile
Change the file used for writing error conditions to logfile. The default is to report a message using the syslog.3 facility.


Access Control

Access control is provided by two means. First, all requests must come from one of the machines listed in either the file /etc/hosts.equiv or /etc/hosts.lpd. (This latter file is in hosts.equiv.5 format.) Second, if the rs capability is specified in the printcap entry, lpr.1 requests are only be honored for users with accounts on the printer host.

Lock File

The lock file in each spool directory is used to prevent multiple daemons from becoming active, and to store information about the daemon process for lpr.1 lpq.1 and lprm.1

lpd uses flock.2 to provide exclusive access to the lock file and to prevent multiple daemons 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 file name of the current job being printed. The second line is updated to reflect the current status of lpd for the programs lpq.1 and lprm.1

Control Files

After the daemon has successfully 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 that indicates what to do with the remainder of the line.
Job name to print on the burst page.
Classification line on the burst page.
Literal. This line contains identification information from the password file, and causes a burst page to be printed.
Title string for page headings printed by pr.1v
Hostname of the machine where lpr.1 was invoked.
Person. Login name of the person who invoked lpr.1 This is used to verify ownership by lprm.1
Send mail to the specified user when the current print job completes.
Formatted File, the name of a file to print that is already formatted.
Like f, but passes control characters along, and does not make page breaks.
Name of a file to print using pr.1v as a filter.
Troff File. The file contains troff.1 output (cat phototypesetter commands).
Ditroff File. The file contains device independent troff output.
DVI File. The file contains TEX output (DVI format from Stanford).
Graph File. The file contains data produced by plot.3x
Cifplot File. The file contains data produced by cifplot.
The file contains a raster image.
The file contains text data with FORTRAN carriage control characters.
Troff Font R. The name of a font file to use instead of the default.
Troff Font I. The name of the font file to use instead of the default.
Troff Font B. The name of the font file to use instead of the default.
Troff Font S. The name of the font file to use instead of the default.
Width. Changes the page width (in characters) used by pr.1v and the text filters.
Indent. Specify the number of characters by which to indent the output.
Unlink. The name of file to remove upon completion of printing.
Filename. The name of the file being printed, or a blank for the standard input (when lpr.1 is invoked in a pipeline).

Data Files

When a file is spooled for printing, the contents are copied into a data file in the spool directory. Data file names begin with df. When lpr is called with the -s option, the control files contain a symbolic link to the actual file, and no data files are created.

Minfree File

The file minfree in each spool directory contains the number of kilobytes to leave free so that the line printer queue won't completely fill the disk.


printer description file
spool directories
minimum free space to leave
line printer devices
socket for local requests
hosts allowed equivalent host access
hosts allowed printer access only


lpq.1 lpr.1 lprm.1 hosts.5 hosts.equiv.5 printcap.5 lpc.8 pac.8

index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).

Last modified 21/April/97