Installation guide
10.7.2.1 Spooling Directory Files
A spooling directory contains a status file and a lock file that are created
by the lpd daemon when a file is queued for printing. The lock file
contains control information about the current print process. For example,
it can inform the lpd daemon that the printer is printing a job. The lock
file prevents the lpd daemon from invoking another job on the printer
while a file is printing. The lock file contains the process identification
number of the daemon that is currently running. The status file contains
a line that describes the current printer status. This line is displayed if a
user inquires about printer status. If a printer whose status is queried is
not active, the status message written to standard output is no entries.
When the lpd daemon is activated as a result of a print request, it looks in
the printer spooling directory for a lock file. If a lock file is not found, the
lpd daemon creates one and writes the identification number and the
control file name on two successive lines in the file. The lpd daemon then
scans the printer spooling directory for command files whose names begin
with cf. Command files specify the names of user files to be printed and
contain printing instructions for the files. Each line in a command file
begins with a key character that indicates what to do with the remainder
of the line. The key characters and their meanings are described in detail
in the lpd
(8) reference page.
Data files, whose names begin with df, are also located in the spooling
directory. Data files contain text formatted for printing. These files are
identified by their print request identification numbers only.
After a file is printed, the lpd daemon removes the control and data files
from the printer spooling queue, updates the status file, and sets up the
next file in the spooling queue for printing.
For example, if a printer named milhaus has jobs currently waiting to be
printed, the following command lists the files that are stored in the
spooling directory:
# ls −l /var/spool/lpd/milhaus
-rw-rw---- 1 root 75 Jan 17 09:57 cfA0220mothra
-rw-rw---- 1 root 96 Jan 17 10:03 cfA143harald
-rw-rw---- 1 root 199719 Jan 17 09:57 dfA0220mothra
-rw-rw---- 1 root 9489 Jan 17 10:03 dfA143harald
-rw-r--r-- 1 root 20 Jan 17 10:06 lock
-rw-rw-rw- 1 daemon 113 Jan 17 10:00 status
10.7.2.2 Creating a Spooling Directory
If you want to manually add a printer, use the mkdir command to create
the spooling directories for each printer. The spooling directory permission
Administering the Print Services 10–21