Previous Table of Contents Next

History Logs

The LP print service records a history of printing services in three log files: lpNet, lpsched, and requests. These log files are located in the /var/lp/ logs directory. You can use the information in these logs to diagnose and troubleshoot printing problems. Here is an example of the contents of the /var/lp/logs directory:

# cd /var/lp/logs
# ls
lpsched.1    requests    requests.2
lpsched     lpsched.2    requests.1

The files with the .1 and .2 suffixes are copies of the previous day's logs. Each day, the lp cron job cleans out the lpsched and requests log files; it keeps copies for two days.

The most important log file for troubleshooting is the lpsched log, which contains information about local printing requests.

The requests log contains information about print requests that have completed and are no longer in the print queue. Once a request is finished printing, the information in the /var/spool/lp log files is combined and appended to the /var/lp/logs/requests file.

The requests log has a simple structure, and you can extract data by using common UNIX shell commands. Requests are listed in the order they are printed and are separated by lines showing their request IDs. Each line below the separator line 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.

Here is an example of the contents of a requests log:

# pwd
# tail requests.2
= slw2-2Ø, uid 2ØØ, gid 2ØØ, size 5123, Mon Nov 18 Ø1:24:Ø1 EST 1991
z slw2
C 1
D slw2
F /etc/motd
P 2Ø
t simple
U irving
s ØxØ1ØØ

Table 6-8 shows the codes in the LP requests log.

Table 6-8 Codes in the LP Requests Log

Character Content of Line
= The separator line. It contains the following items, separated by commas: the request ID, the user ID and group IDs of the user, the total number of bytes in the original (unfiltered) files, and the time when the request was queued. The user ID, group IDs, and file size are preceded by the words uid, gid, and size, respectively.
C The number of copies printed.
D The printer or class destination, or the word any.
F The name of the file printed. The line is repeated for each file printed; files were printed in the order shown.
f The name of the form used.
H One of three types of special handling: resume, hold, and immediate. The only useful value found in this line will be immediate.
N The type of alert used when the print request was successfully completed. The type is the letter M if the user was notified by e - mail or W if the user was notified by a message to the terminal.
O The - o options.
P The priority of the print request.
p The list of pages printed.
r This single - letter line is included if the user asks for raw processing of the files (the - r option of the lp command).
S The character set or printwheel (or cartridge) used.
s The outcome of the request, shown as a combination of individual bits expressed in hexadecimal form. Although several bits are used internally by the print service, the most important bits are listed here:
0x0004  Slow filtering finished successfully.
0x0010  Printing finished successfully.
0x0040  The request was canceled.
0x0100  The request failed filtering or printing.
T The title placed on the banner page.
t The type of content found in the file(s).
U The name of the user who submitted the print request.
x The slow filter used for the print request.
Y The list of special modes to give to the print filters used to print the request.
z The printer used for the request. This printer differs from the destination ( the D line) if the request was queued for any printer or a class of printers, or if the request was moved to another destination.

Spooling Directories

Files queued for printing are stored in /var/spool/lp directory until they are printed. Table 6-9 shows the contents of the /var/spool/lp directory.

Table 6-9 Contents of the /var/spool/ lp Directory

File Type Description
SCHEDLOCK File Lock file for the scheduler. Check for this file if the scheduler dies and won't restart.
admins Directory Linked to /etc/lp.
bin Directory Linked to /usr/lib/lp/bin.
fifos Directory Contains pipes that convey networked print requests to and from the lpNet daemon.
logs Link Linked to ../lp/logs where completed print requests are logged.
model Link Linked to /usr/lib/lp/model.
requests Directory Contains a directory for each configured printer where print requests are logged until printed. Users cannot access this log.
system Directory Contains a print status file for the system.
temp Link Linked to /var/spool/lp/tmp/ printer-name, which contains the spooled requests.
tmp Directory Contains a directory for each configured printer where print requests are logged until printed. Changes to existing print requests are also recorded in this log.

Previous Table of Contents Next