11.5.1.1 Using Filters

11.6 Clearing and Preventing Queue Hangs in AIX

In the AIX printing subsystem the file that defines queues is /etc/qconfig. This file is translated 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 new or modified queue can print. When small jobs are printing, this is not a problem since 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 new or modified queues will appear hung until this condition is cleared and the printing finishes.

In order to correct a hung queue follow this procedure:

  1. Run the lpstat command to get the status of the queue as follows:
    
    # lpstat
    Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk
    ------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
    lpforu  lp0   DEV_WAIT    5 /etc/hosts         root                   2   1   1
                  QUEUED      6 /etc/hosts         root                   2   1   2
                  QUEUED      7 /etc/hosts         root                   2   1   3
                  QUEUED      8 /etc/hosts         root                   2   1   4
    
    

  2. Stop the qdaemon before making any changes to a queue. This is easily done with the following command:
    # stopsrc -c -s qdaemon
    0513-044 The stop of the qdaemon Subsystem was completed successfully.
    

  3. Make sure the qdaemon has stopped completely by checking with:
    # lssrc -s qdaemon
    Subsystem         Group            PID     Status
     qdaemon          spooler                  inoperative
    

  4. Use lpstat or enq -sA to look for any DEV_WAIT conditions. Wait until all RUNNING jobs are completed, but do not worry about jobs that are QUEUED at this time with a NEW job number in AIX 3. You will not see any of these jobs in AIX 4.

  5. Clear any DEV_WAIT conditions or cancel the jobs on those queues. Wait until any RUNNING jobs are finished. For details on clearing jobs, see section 11.7 Flushing a Print Job.

  6. If any of these conditions persist and you are unable to cancel the jobs, 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 follows.

    For example, if the file is /var/spool/lpd/stat/p.lpforu.lp0, then run the following command:

    cat /var/spool/lpd/stat/p.lpforu.lp0

    This returns the value:

    28080
    

    Verifying that 28080 is the pid for the qd fork process, run:

    # ps -ef|grep 28080
        root 28080 35258   0 10:52:13      -  0:00 qd fork
        root 35720 28570   2 10:56:54  pts/3  0:00 grep 28080
    

    To kill this process run the command:

    kill -9 28080
    

    To check if the process has stopped run:

    # ps -ef | grep 28080
    root 28084 28570   1 10:59:25  pts/3  0:00 grep 28080
    

Note

Some commands may require root user or system group authority.

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

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

startsrc -s qdaemon

11.7 Flushing a Print Job