It seems the default behavior of the AIX print queue is to report queue errors to the user that submitted the print job. We have several hundred queues used by unattended scripts and cron jobs running under system accounts that are not intended to recieve mail.

What I would like to do, and have tried unsuccessfully to do, is to stop these error reports from being directed to the users that submit jobs, and instead direct them to another address. This is what I have tried, with no effect:

chque -q'queue_name' -a"recovery_type = sendmail "'queue_errors@example.com'

This added the expected configuration to /etc/qconfig. I restarted lpd, but error messages are still being sent to users. Furthermore, error messages are not delivered to queue_errors@example.com.

This is on AIX 5.3. A typical error that I'd like to redirect:

Message from queueing system:
Queue hs-3841:@print went down, job is still queued:
  Backend: /usr/lib/lpd/rembak -S print.example.com -P hs-3841 -N \
           /usr/lib/lpd/aixshort /var/spool/lpd/dfA731sub.sub.example.com.1280424810.1028194 
  Backend Exit Value: EXITFATAL (0100)
  Job Submit Time: Mar 21 03:33:30 2011,  Current Time: Mar 21 12:00:51 2011
Use local problem reporting procedures.

I know I can adjust rembak to try to avoid errors due intermittent remote queue downtime, but how can I configure lpd in such a way as to direct queue errors to an address other than the user's?


Since this has been sitting out there for a couple days, and in that time I've (mostly) figured out the problem, I'll post the answer that works for me.

In brief:


Where QUEUNAME, DEVICENAME and USERNAME are set to the queue, device and user to whom you'd like to have errors sent.

In full:

AIX print queues have virtual printers and print devices associated with each queue. The command chque, as given in the question, is used to manage attributes of the queue. Setting "recovery_type" to "sendmail address@example.com" will cause notification to be sent the the address specified when the queue is down, but it won't stop all printer errors from being dispatched to the user that submitted the print job.

By default, virtual printer error messages will be sent to the job submitter via the writesrv daemon. Writesrv will issue the messages to the user's console if they are logged in. If they are not logged in at the time of the error, or if the writesrv daemon on the remote host (if applicable) is not listening, an email will be sent to the user at the host from which the job was sent.

In order to completely answer the question, you have to set the si parameter in the virtual printer colon file via the chvirprnt command with the name of a user to receive errors, and also arrange for the local MTA to forward mail for that user to queue_errors@example.com. It is advisable to create a user for this purpose, or send errors to root and further refine mail delivery for the root user to route the error messages as desired.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.