Technical article 118831

My LPD network printer is not logging jobs through the spooler.

OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

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/lpshut

Next, move the file /usr/bin/lp to /usr/bin/lp.orig:

# mv /usr/bin/lp /usr/bin/lp.orig

Next, vi a file with the original name /usr/bin/lp:

# vi /usr/bin/lp
And 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 "--------" >> $LOG

Save 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/lp

The 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/lpsched

The 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)

From the Xinuos technical article database, record 118831. Reproduced with permission. The original is at www.sco.com/ta/118831, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.