11/08/95 Printing in AIX 4.1 SPECIAL NOTICES Information in this document is correct to the best of our knowledge at the time of this writing. Please send feedback by fax to "AIXServ Information" at (512) 823-4009. Please use this information with care. IBM will not be responsible for damages of any kind resulting from its use. The use of this information is the sole responsibility of the customer and depends on the customer's ability to eval- uate and integrate this information into the customer's operational environment. ABOUT THIS DOCUMENT This document provides an overview of printing in AIX 4.1, and contains the following sections: o How It Works o Terminology o Commands o qdeamon o Suggested Reading 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 redi- recting the file to the device (e.g., with the "cat" command). Printing in AIX 4.1 1 11/08/95 Device Driver | | cat --------------> User Defined -----> Printer | | splp PRINTER TERMINOLOGY o Printer/Plotter Device This is the special file in the /dev/ directory for the device. It can only be used by redirection (e.g. cat filename > /dev/lp0) and may be manipulated with "splp". Printer commands will not be able to access a "Printer Device" unless a "Print Queue" has been created or a change made to the printer backend in /etc/qconfig. o Print Queue The Print Queue is really a combination of a specific Queue and Queue Device in the "/etc/qconfig". Also, depending on the backend that you select when adding the queue, the associated files will determine the function of that queue. Here is a list in smit of the possible choices for a Print Queue backend. ( Note: You may or may not have all of these options, depending on what you've installed) Add a Print Queue Move cursor to desired item and press Enter. Use arrow keys to scroll. # ATTACHMENT TYPE DESCRIPTION local Printer Attached to Local Host remote Printer Attached to Remote Host xstation Printer Attached to Xstation ascii Printer Attached to ASCII Terminal hpJetDirect Network Printer (HP JetDirect) file File (in /dev directory) other User Defined Backend F1=Help F2=Refresh F3=Cancel F8=Image F10=Exit Enter=Do /=Find n=Find Next The Print Queue, when added through smit, will automat- ically create the Queue, Queue Device, and any control files needed. To create a Queue and Queue Device for a printer that will use the standard piobe backend, choose local. To add a second Queue Device to an existing Queue, to allow load sharing, select "Add an Additional Printer to an Existing Print Queue". o Queue Printing in AIX 4.1 2 11/08/95 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 o 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 Print Queue can handle this as it associated itself with a "Queue:Queue Device" pair. 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 local Print Queue. Local Print Queue settings can be configured using smit, under the Programming tools menu. 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" direc- tory. If the job is not a file (e.g., 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". Printing in AIX 4.1 3 11/08/95 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 (e.g., lpstat, 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 -cs qdaemon" (if there are no jobs queued). To start the qdaemon again, use "startsrc -s qdaemon". SUGGESTED READING "AIX Version 4.1 System Management Guide" from IBM. Order number is SC23-2525-00 Printing in AIX 4.1 4 11/08/95 READER'S COMMENTS Please fax this form to (512) 823-4009, attention "AIXServ Informa- tion". You may also e-mail comments to: elizabet@austin.ibm.com. These comments should include the same customer information requested below. Use this form to tell us what you think about this document. If you have found errors in it, or if you want to express your opinion about it (such as organization, subject matter, appearance) or make sug- gestions for improvement, this is the form to use. If you need technical assistance, contact your local branch office, point of sale, or 1-800-CALL-AIX (for information about support offer- ings). These services may be billable. Faxes on a variety of sub- jects may be ordered free of charge from 1-800-IBM-4FAX. Outside the U.S. call 415-855-4329 using a fax machine phone. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. NOTE: If you have a problem report or item number, supplying that number may help us determine why a procedure did or did not work in your specific situation. Problem Report or Item #: Branch Office or Customer #: Be sure to print your name and fax number below if you would like a reply: Name: Fax Number: ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ END OF DOCUMENT (print.41.zap) Printing in AIX 4.1 5