Problem
I have a network printer installed on OpenServer 5 that is using the
LPD protocol. While my local printers are saving the job information
in /usr/spool/lp/logs/requests, any jobs sent out to the network
printer do not get logged. Cause
The lpd(ADMN) printer daemon will only log error messages to the file /usr/adm/messages; there is no setting for lpd(ADMN) to log print jobs.
Solution
You can make lp log all print jobs to a specific log file by creating a wrapper for lp that will log information and then call the real lp binary.
First, shutdown the scheduler with the command:
# /usr/lib/lpshutNext, move the file /usr/bin/lp to /usr/bin/lp.orig:
# mv /usr/bin/lp /usr/bin/lp.origNext, vi a file with the original name /usr/bin/lp:
# vi /usr/bin/lpAnd enter the following lines:#!/bin/sh
LOG=/usr/spool/lp/logs/lpd.log
date >> $LOG
echo "$*" >> $LOG
/usr/bin/lp.orig $* >> $LOG 2>&1
echo "--------" >> $LOGSave this file and make sure /usr/bin/lp has the right permissions and user/group:
# chmod 2111 /usr/bin/lp
# chgrp lp /usr/bin/lp
# chown bin /usr/bin/lpThe permissions on both files should look like this:
---x--s--x 1 bin lp 2600 Feb 23 2000 /usr/bin/lp
---x--s--x 1 bin lp 2600 Feb 23 2000 /usr/bin/lp.orig@Now restart the scheduler with:# /usr/spool/lpschedThe lp command will now log any LPD network printer jobs to the file /usr/spool/lp/logs/lpd.log.
See also
lpd(ADMN), lp(C)