ITEM: BD4968L

How to prevent qdaemon hangs



Question:

Customer has busy printing system, and queues hang
after he makes changes to queues.  What can he do?

Response:

Queue hangs when changing or adding queues, what causes them
and what to do to prevent them.

Overview:  In the AIX printing subsystem the file that defines
queues is /etc/qconfig.  This file is 'digested' into a binary
form called /etc/qconfig.bin.  When the qdaemon is printing,
this file is loaded into memory and used by the associated
printing programs.  When a change is made to /etc/qconfig, the
current print jobs using the memory version of the file must
complete printing before the new qconfig.bin can be loaded into
memory for the new jobs to print.  Thus the current printing jobs
must all finish before any jobs on the queue can print.  When
small jobs are printing, this is not a problem as the individual
jobs finish quickly, and printing continues; but when a large job
is printing, or when a queue is in a DEV_WAIT state, all queues
will appear hung until this condition is cleared and the printing
finishes.

An lpstat or enq -A will show new jobs in the following status:

Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
ps      lp0   READY
              QUEUED    NEW /etc/motd          root                   6   1   1

Notice the queue is READY and a job is queued.  This is a sign that
a queue has been changed, but the last operation has not completed.

Prevention:  Don't change queues when jobs are printing.  One easy
way to prevent this is to stop the qdaemon before making any changes
to a queue.  This is easily done with the following command:

\# stopsrc -c -s qdaemon

Make sure the qdaemon has stopped completely by checking with:

\# lssrc -s qdaemon
Use lpstat or enq -sA to look for any DEV_WAIT conditions.  Wait
until all RUNNING jobs are completed, but don't worry about jobs
that are QUEUED at this time with a NEW job number.

Clear any DEV_WAIT conditions or cancel the jobs on those queues.
Wait until any RUNNING jobs are finished.

If any of these conditions persist and you are unable to cancel the
jobs, then look in the /var/spool/lpd/stat directory for files that
begin with a "p.",   This indicate active jobs that need to finish
or be cleared.  The file contains the pid (process id) for the qd fork
or other associated backend printer program. Often these programs can
be cleared out manually as shown below.

example: /var/spool/lpd/stat/p.asc.lp0
        cat /var/spool/lpd/stat/p.asc.lp0
        16753
        kill -9 16753
        ps -ef | grep 16753

Make changes to the queue, and then start the qdaemon back up with:
This is the time to add new queues.

Once the system has been cleared,  printer jams fixed, paper trays filled,
and in general the queues show READY, the qdaemon can be restarted and
the printing subsystem should be in good health again.

\# startsrc -s qdaemon

Summary:
1.  Never change the queues or add queues while jobs are printing.
2.  Prevent new jobs submitted from interfering by stopping the qdaemon.
3.  Clear all paper jams, or disable queues with problems before
    making any changes.
4.  Restart the qdaemon after making changes.

NEXT: Email to SSOS, Close


Support Line: How to prevent qdaemon hangs ITEM: BD4968L
Dated: January 1996 Category: N/A
This HTML file was generated 99/06/24~13:30:23
Comments or suggestions? Contact us