Printing in AIX 3.2


Contents

About This Document
    Related Documentation
How It Works
Printer Terminology
The Printing Commands
The qdaemon Program

About This Document

This document contains information about printing in AIX 3.2.

Related Documentation

Consult the "AIX Version 3.2 System Management Guide" from IBM (SC23-2457-00).


How It Works

The printing command places the file, plus any print flags, onto the queue. When the printer is ready, the qdaemon passes the file and flags to the printer backend which formats the output for the specific printer. The data is then passed to the Printer Device driver, which communicates with the actual device and prints the file (see figure below).

enq--> Queue--> Backend 
                   | 
                   | 
                 piobe ------->  Device Driver  ----+  
                   |                                | 
                   |                             Printer 
                   |                                | 
                   cat ------->  User Defined   ----+  

It is also possible to bypass the queue and backend by redirecting the file to the device (for example, with the cat command).

                               Device Driver 
                                     | 
                                     | 
cat  ----------------------->  User Defined  ----->  Printer 
                                     | 
                                     | 
                                    splp 

Printer Terminology

"Printer/Plotter Device"

This is the special file in the /dev/ directory for the device. It can only be used by redirection (for example, cat filename > /dev/lp0) and may be manipulated with splp. Printer commands will not be able to access a Printer Device unless a Virtual Printer has been created or a change made to the printer backend in /etc/qconfig.

"Virtual Printer"

The Virtual Printer is really a combination of a specific Queue and Queue Device in the /etc/qconfig file plus the associated file in the /var/spool/lpd/pio/ddi directory (which contains formatting data). The Virtual Printer, when added through smit, will automatically create the Queue, Queue Device, and ddi file.

To create a Queue and Queue Device for a printer that will use the standard piobe backend, add a Virtual Printer.

To add a second Queue Device to an existing Queue, to allow load sharing, add a second Virtual Printer to an existing Queue.

"Queue"

The Queue is where the user directs a print job. It is a stanza in the /etc/qconfig file whose name is the name of the Queue and which points to the associated Queue Device.

lp0: 
device = lp0 

Only add a Queue when the backend will NOT be the standard piobe backend. Adding a Virtual Printer is the normal way to create a Queue and Queue Device.

"Queue Device"

The Queue Device is the stanza in the /etc/qconfig file that normally follows the local Queue stanza. It specifies the actual /dev/ file (Printer Device) to which printing should be done and the "backend" that should be used.

lp0: 
file = /dev/lp0 
header = never 
trailer = never 
access = both 
backend = /usr/lpd/piobe 

There may be more than one Queue Device associated with a single Queue. The Virtual Printer can handle this as it associated itself with a "Queue&:Queue Device" pair.

Only add a Queue Device to an existing Queue if it is to use a backend other than the standard piobe backend. Adding a Virtual Printer will create a standard Queue Device entry to an existing Queue.

NOTE: With a remote printer, there will be no file entry in the Queue Device stanza in the /etc/qconfig file, as the Queue directs the file to the server.


The Printing Commands

There are now four commands which use the piobe that can be used to print the files. The four commands are enq, lp, lpr, and qprt. These commands bypass some of the splp settings, since they use the settings that are contained in the Virtual Printer. The Virtual Printer settings can be configured using smit.

The commands lp, lpr, and qprt are actually just a front end to the enq command. Therefore the first thing that happens to a printed file is that it is passed to the enq program. The enq program simply places the information about the file, along with the flags, in the Queue for the qdaemon to use. The Queue is actually the /var/spool/lpd/qdir directory.

If the job is not a file (for example, pipe output of a command to enq) then a real file is created in /var/spool/qdaemon which contains the data to be printed. The information in the /var/spool/lpd/qdir file then points to the file in /var/spool/qdaemon.


The qdaemon Program

The qdaemon is a process that runs in the background. It is generally started with the startsrc command when the system is powered on. startsrc is a command to the srcmstr daemon which is started from /etc/inittab.

The qdaemon keeps track of the print requests in the /var/spool/lpd/qdir directory and ensures that the jobs are sent to the proper printer at the proper time. It also keeps track of the status of the printers and stores printer usage data for system accounting purposes (for example, lpstat and enq -a commands). This information is held in the /var/spool/lpd/stat directory.

If the qdaemon is killed it will be restarted by the srcmstr.

NOTE: Never kill the srcmstr process because it controls other daemons that will be running on the system.

To stop the qdaemon, issue enq -G or stopsrc -s qdaemon (if there are no jobs queued).

To start the qdaemon again, use startsrc -s qdaemon.


Printing in AIX 3.2: print.32.zap ITEM: FAX
Dated: 99/01/04~00:00 Category: zap
This HTML file was generated 99/06/24~12:41:59
Comments or suggestions?
Contact us