This section describes the directory structure, files and logs of the LP print service.
The files of the LP print service are distributed among the directories that are shown in the following table.
Table 7.1. Directories for the LP Print Service
Directory |
Contents |
---|---|
|
The LP print service user commands. |
|
A hierarchy of LP server configuration files. |
|
The |
|
The lp conversion scripts, in.lpd daemon,
and the printd daemon. The printd daemon
transfers all pending jobs in the |
|
The LP print service administrative commands |
|
The lpsched program, binary files, PostScript filters,
and the |
|
LP log files such as |
|
The spooling directory where files are queued for printing. |
|
The staging area for LP print service client-side requests. |
|
The location of the interface script that process |
The lpsched daemon stores configuration information
in the /etc/lp
directory, as described in the following
table.
The configuration files listed in this table are private interfaces. These files are subject to change in future releases. You should not build software that relies on these files being in their current locations or that relies on the data being in the format currently used.
Table 7.2. Contents of the /etc/lp
Directory
File |
Type |
Description |
---|---|---|
|
Directory |
Files identifying classes provided by the lpadmin -c command. |
|
Directory |
Description of existing filters. |
|
File |
Print filter look-up table. |
|
Directory |
Location to put files for each form. Initially, this directory is empty. |
|
Directory |
Printer interface program files. |
|
Link to |
Log files of printing activities. |
|
Link to |
The standard printer interface program. |
|
Directory |
Directories for each local printer. Each directory contains configuration information and alert files for an individual printer. |
|
Directory |
Print wheel files or cartridge files. |
|
Directory |
Each local queue that is configured with a PPD file has a copy of the PPD file placed here. |
These configuration files serve a function similar to the /etc/printcap
file on lpd-based print servers.
You can check the contents of the configuration files, but you
should not edit these files directly. Instead, use the lpadmin command
to make configuration changes. Your changes are written to the configuration
files in the /etc/lp
directory. The lpsched
daemon
administers and updates the configuration files.
The /etc/lp/printers
directory has a subdirectory
for each local printer that is known to the system. The following example
shows the /etc/lp/printers
subdirectories of printers sparc1
and luna
.
$ ls -l /etc/lp/printers
drwxrwxr-x 2 lp lp 512 Jan 23 23:53 luna
drwxrwxr-x 2 lp lp 512 Jan 11 17:50 sparc1
The following table describes the files within each printer-specific directory.
File Name |
Description |
---|---|
|
Shell to execute in response to alerts |
|
Alert variables |
|
Configuration file |
|
List of users to whom printer access is denied |
|
Printer description |
The configuration file for the printer luna, /etc/lp/printers/luna/configuration
, would typically appear as follows:
Banner: on: Always Content types: PS Device: /dev/term/b Interface: /usr/lib/lp/model/standard Printer type: PS Modules: default
The /usr/share/lib
directory contains the terminfo
database directory. This directory contains definitions for many
types of terminals and printers. The LP print service uses information in
the terminfo
database to perform the following tasks:
Initializes a printer
Establishes a selected page size, character pitch, line pitch, and character set
Communicates the sequence of codes to a printer
Each printer is identified in the terminfo
database
with a short name. For a description of the structure of the terminfo
database,
see Printer Type. If necessary, you
can add entries to the terminfo
database, but doing so
is tedious and time-consuming For more information, see Adding a terminfo
Entry for an Unsupported Printer.
The /usr/lib/lp
directory contains daemons
and files used by the LP print service, as described in the following table.
Table 7.3. Contents of the /usr/lib/lp
Directory
File |
Type |
Description |
---|---|---|
|
Directory |
Contains files for generating printing alerts, slow filters, and queue management programs. |
|
Directory |
Contains the standard printer interface program. |
|
Directory |
Contains all PostScript filter programs provided by the LP print service.
These filters come with descriptor files in the |
The LP print service maintains two sets of log files that are described in the following table.
Log File Name |
Description |
---|---|
syslogd |
Set |
|
A list of current requests that are in the print queue |
|
An ongoing history of print requests |
The scheduler for each system keeps a log of print requests in
the /var/spool/lp/tmp/
system
and /var/spool/lp/requests/
system
directories.
Each print request has two files, one file in each directory, that contain
information about the request. The information in the /var/spool/lp/requests/
system
directory can be accessed only
by superuser or lp
. The information in the /var/spool/lp/tmp/
system
directory can be accessed only
by the user who submitted the request, superuser, or lp
.
The following example shows the contents of the /var/spool/lp/tmp/starbug
directory:
$ls /var/spool/lp/tmp/starbug
5 5-0 #cat 5-0
C 1 D print1 F /etc/profile P 20 T /etc/profile t simple U root s 0000 v 2
These files remain in their directories only as long as the print request
is in the queue. Once the print request is finished, the information in the
files is combined and appended to the /var/lp/logs/requests
file.
This file is described in the next section.
Use the information in the /var/spool/lp/logs
directory
if you need to track the status of a print request that is currently in the
queue.
The LP print service records a history of printing services in two log
files, lpsched
and requests
. These
log files are located in the /var/lp/logs
directory.
You can use the information in these log files to diagnose and troubleshoot
printing problems. An example of the contents of the /var/lp/logs
directory
is as follows:
#cd /var/lp/logs
#ls
lpsched.1 requests requests.2 lpsched lpsched.2 requests.1 #
The two most important log files for troubleshooting are the following:
The lpsched
log file — Contains
information about local printing requests.
The requests
log file — Contains
information about print requests that are completed and no longer in the print
queue.
The requests
log file has a simple structure so
that you can extract data using common UNIX shell commands. Requests are listed
in the order they are printed. They are also separated by lines showing their
request IDs. Each line below the separator line, the line that starts with
=, is marked with a single letter that identifies the kind of information
contained in that line. Each letter is separated from the data by a single
space.
The following example shows the contents of a requests
log
file:
#pwd
/var/lp/logs #tail requests.2
= print1-3, uid 0, gid 1, size 206662, Wed Mar 14 08:56:30 MST 2003 z print1 C 1 D print1 F /usr/dict/words P 20 T /usr/dict/words t simple U root s 0x0014 v 2 #
The following table shows the letter codes and the content of
their corresponding lines in the requests
log file.
Table 7.4. Codes in the requests
Log
File
Letter |
Content of Line |
---|---|
|
The separator line, which contains the following items: request ID, user ID (UID), and group IDs (GIDs) of the user, the total number of bytes in the original (unfiltered) file size, and the time when the request was queued. |
|
The name of the printer. |
|
The number of copies printed. |
|
The printer or class destination, or the word |
|
The name of the file printed. The line is repeated for each file printed. Files were printed in the order shown. |
|
(Optional) The name of the form used. |
|
(Optional) One of three types of special handling: resume, hold, and immediate. |
|
(Optional) The type of alert used when the print request was successfully
completed. The type is the letter |
|
(Optional) The printer-dependent |
|
The priority of the print request. |
|
The list of pages printed. |
|
(Optional) A single-letter line that is included if the user asked for “raw” processing of the files with the lp -r command. |
|
(Optional) The character set, print wheel, or cartridge used. |
|
The title placed on the banner page. |
|
The type of content found in the files. |
|
The name of the user who submitted the print request. |
|
The outcome of the request, shown as a combination of individual bits expressed in hexadecimal format. Several bits are used internally by the print service. The bits and what they mean are described in the following table. |
|
|
|
(Optional) The slow filter used for the print request. |
|
(Optional) The list of special modes for the print filters used to print the request. |
|
(Optional) The printer used for the request. This printer differs from
the destination (the |
The following table shows the outcome codes in the LP requests
log
file and their descriptions.
Table 7.5. Outcome Codes in the requests
Log File
Outcome Code |
Description |
---|---|
|
The request was held pending resume. |
|
Slow filtering is running. |
|
Slow filtering finished successfully. |
|
The request is on the printer. |
|
Printing finished successfully. |
|
The request was held pending user change. |
|
The request was canceled. |
|
The request will print next. |
|
The request failed filtering or printing. |
|
The request is in transit to a remote printer (obsolete). |
|
The user will be notified. |
|
A notification is running. |
|
A remote system has accepted the request (obsolete). |
|
The administrator placed a hold on the request. |
|
The printer had to change filters. |
|
The request is temporarily stopped. |
Files queued for printing are stored in the /var/spool/lp
directory
until they are printed, which might be only seconds. The following table shows
the contents of the /var/spool/lp
directory.
Table 7.6. Contents of the /var/spool/lp
Directory
File |
Type |
Description |
---|---|---|
|
File |
Lock file for the scheduler. Check for this file if the scheduler terminates and will not restart. |
|
Directory |
Link to |
|
Directory |
Link to |
|
Link |
Link to |
|
Link |
Link to |
|
Directory |
Directory that contains subdirectories for each configured printer where print requests are logged until printed. Users cannot access this log. |
|
Directory |
A print status file for the system. |
|
Link |
Link to |
|
Directory |
Directory for each configured printer where print requests are logged until printed. Changes to existing print requests are also recorded in this directory. |