The printer subsystem includes spoolers, real printers, virtual printers, backends, and queues. A printer can be attached directly to a local system, or a print job can be sent over a network to a remote system.
SMIT can be used to set up the printer. SMIT allows the printer device to be created, the virtual printer to be added and customized, and the queues to be manipulated.
Although it is possible to start SMIT with the smit command to
access the printing menus, the simplest way is to use smit printer.
The data flow is shown in the following diagram:
Figure: Data Flow of a Print Job
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.
It is also possible to bypass the queue and backend by redirecting the file to the device (with the cat command).
AIX uses the virtual printer concept which allows more control over each printer, and more customization. The following section describes the new terminology to enable the rest of this chapter to be understood.
This is the special file in the /dev directory for the device. It can only be used by redirection (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.
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 /usr/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.
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.
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) that should be printed to 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.
When using 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 following diagram demonstrates some of the possible combinations of
queues that can be configured in AIX on the RISC System/6000.
Figure: Possible Combinations of Queues
There are four commands which use the piobe that can be used to print the files. The four commands are lp, lpr (UNIX commands), and qprt, enq (AIX commands). These commands ignore some of the splp settings (splp command allows to change or to display printer driver 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 deal with. The queue is actually the /var/spool/qdaemon directory.
If the job is not a file (for example the output of a command piped 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 print files are saved by default in a temporary location: the directory /var/spool/qdaemon.
The print files are not saved by default in a temporary location.
The significant difference is illustrated after a print job is submitted:
Changing the file submitted has no affect on the print output
Changing the file submitted can change the print output
The AIX queueing system supports the lp, lpr, enq and qprt commands.
When you work with a local printer you can use these commands:
This command works by default as spooler (copy of the file in a temporary location: the directory /var/spool/qdaemon).
If you use lpr as a print command, it is important to look after the size of this directory when you want to print a lot of files or big files.
This command works by default as queueing (no copy of the file in a temporary location)
This command works by default as queueing (no copy of the file in a temporary location)
When you work with a remote printer the print files are always saved in a temporary location: the directory /var/spool/lpd/qdir.
Qdaemon generally starts 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. This information is held in the /var/spool/lpd/stat directory.
If the qdaemon is stopped it will be restarted by the srcmstr command.
To stop the qdaemon issue the following command:
# enq -GThis is the preferred method of taking the qdaemon down gracefully. If there are no jobs queued, then the qdaemon may be stopped with the following command:
# stopsrc -s qdaemon
Either way the qdaemon can be started again with the following command:
# startsrc -s qdaemon
Note: Always ensure that qdaemon is definitely not running before starting it as a second qdaemon will adversely affect the printing subsystem. If a second qdaemon is accidentally started then this may be stopped with the kill -9 command. This method should never be used to stop the qdaemon under normal conditions.
The qdaemon runs a backend process when output is sent to a particular device. The qdaemon sends to the backend process the names of files to be printed and any specified print flags. The backend uses the printer control information supplied from the ddi files to format the data before it is sent to the device driver. This printer control information is customized with SMIT using the Change / Show Characteristics of a Virtual Printer option.
The ddi information is found in /var/spool/lpd/pio/ddi where a ddi file exists for each virtual printer that has been created. This ddi information is created when the virtual printer is added, from the information in /usr/lpd/pio/predef directory, where descriptions of all supported printers are held.
When the virtual printer is added, a relevant printer control file in the directory /usr/lpd/pio/predef is copied to the directory /var/spool/lpd/pio/custom. A digested version is also put into /var/spool/lpd/pio/ddi, which is the version that is actually used.
These copies of the file may be customized via SMIT using the Change / Show Characteristics of a Virtual Printer option. You can also use the SMIT fastpath smit chvirprt. The backend program returns data to the qdaemon via a status file in the /var/spool/lpd/stat directory. This is where the qchk -A command finds the information that it displays.
# qchk -A
queue Dev Status Job Files User PP % Blks Cp Rnk
----- --- ------ --- ------------ --- -- - ---- -- ------
lp0 lp0 READY
lp1 lp0 DOWN
QUEUED 2 /etc/motd Root 3 1 1
bsh bshde READY
The default backend process is piobe, when a printer is added using SMIT. Piobe no longer requires a string of flags in /etc/qconfig because the information is held elsewhere. The information that piobe uses is in the /var/spool/lpd/qdir directory. This information is supplied with the print command and the default files are in the /var/spool/lpd/pio/ddi directory.
For more information on piobe use man piobe to view the manual pages, or search on piobe in InfoExplorer.
The backend program must be a binary executable file. For example, a queue that processes compilation jobs might use the cc program as its backend. To use a shell script as part of a backend, the binary executable is /bin/ksh. The entry in the /etc/qconfig file should look like this:
backend = /bin/ksh /home/user/bin/scriptname
This will execute a shell as a backend. That is the script shell /home/user/bin/scriptname will be executed in the korn shell environment.
Note: You may choose to directly set a shell script as the backend. In this case, you must insert a magic number line at the top of the script shell. It may be this line, if your script has to be run in the korn shell environment:
#!/bin/ksh
TCP/IP allows remote printing from one machine on the network to another. This is achieved by a combination of the TCP/IP daemons and a remote printer backend in the /etc/qconfig file. The client and server can be configured through SMIT using the Manage Remote Printer Subsystem option of the smit printer menu.
The remote printer backend, that is the rembak program, allows the users of the client system to access printers on a remote system. This is particularly useful if there are specific types of printers that are only available from one system but are required by users of another.
The remote printing setup of AIX V3 is described in detail in the publication Printing for Fun and Profit Under AIX V3 and an example is described in Remote Printer Example.
In AIX the splp command is used for changing the device driver characteristics of both parallel and serial printers.
If a printer device is defined but not allocated to any queue, then the only way to access the device is to redirect it with the following command:
# cat /etc/motd > /dev/lp0
In this instance splp is available to allow members of the system group to change some characteristics of the device driver and any user may view them. The splp output for a printer will appear as follows:
# splpNote: When the printing command is used with the piobe backend, splp is set to pass-through during printing. Therefore, some of the splp parameters set by the user are ignored.
device = /dev/lp0 (+ yes ! no)
CURRENT FORMATTING PARAMETERS (ignored by qprt, lpr, and lp commands)
Note: -p + causes the other formatting parameters to be ignored.
-p + pass-through? -c + send carriage returns?
-l 66 page length (lines) -n + send line feeds?
-w 132 page width (columns) -r + cr after lf?
-i 0 indentation (columns) -t + suppress tab expansion?
-W ! wrap long lines? -b + send backspaces?
-C ! convert to upper case? -f + send form feeds?
CURRENT ERROR PROCESSING PARAMETERS
-T 60 timeout value (seconds) -e ! return on error?
CURRENT SERIAL INTERFACE PARAMETERS
-B 9600 baud rate -s 8 character size (bits)
-N ! enable parity? -S ! two stop bits?
-P ! odd parity?
To display the device driver characteristics of the lp0 printer issue the
splp /dev/printer command (where printer is replaced by the
device for example lp0).
Parameters can be changed with the splp command in the following form:
# splp -w 132 -B 9600 lp0
Clearly the printer device name must be that of the printer that has been changed. If the /dev directory is not specified then it is assumed. The above example changes the width to 132 and the baud rate to 9600, until the next reboot or the next splp command. The default printer is lp0.
More information about splp can be found using man splp or searching for splp in InfoExplorer.
To setup a printer you start by issuing the fastpath command for SMIT by typing: smit printer. This will present three options:
This area of SMIT contains all of the options and tools necessary to setup and configure printers. There are two basic steps to adding a printer:
All details about these functions in SMIT are provided in InfoExplorer and an example is described in Local Printer Example and Remote Printer Example.
The first thing that appears to be different when printing on AIX V3 is that the print command echoes the filename to the standard output. This is because the print command is actually a built-in korn shell command that allows display of the value of a string and has nothing to do with printing.
# print myfile
myfile
There are a number of printing commands in AIX from various sources. qprt and enq are from IBM, lp is from AT&T and lpr is from BSD**. This section is provided to describe the ways in which the qprt, qcan, qadm, enq and qchk commands work.
Note: Not all of the options described below are available for every printer. In this case an error message will be returned.
Information about lp, lpr, lpstat, lpq, cancel and lprm can be found using the man command or searching in InfoExplorer.
This is the preferred command for printing on AIX. This command can be run through SMIT by typing smit qprt. Following is a list of examples:
This displays the default settings of the flags that will be used by qprt to print the file, but doesn't print the file.
This prints the file and sends a mail message back with the standard error and the pipeline used.
Note: If a 2 is used then it sends mail even if no error was produced. A 0 option to -A discards standard error output.
This prints the file with a bottom margin of four lines.
This specifies that the burst page should always be printed.
Note: Other options to -B flag are n for never and g for group.
This specifies that a copy of the file be made for printing.
This causes any message generated by the print job to be mailed back to the user.
This specifies to print the file in pass-through mode to the printer. Other flags available for this option are:
Note: If the printer does not support the mode selected the print job is cancelled with an error message.
This causes the print job to be labelled for Mike instead of submitter.
This causes just this file to be printed in emphasized print. The -e ! is for turning emphasis off if it is set as the default.
This causes this file to be printed in double-high print. The -E ! is for turning double-high off if it set as the default.
This causes the file to go through the pr filter before printing.
This specifies the font file to be used when printing the file. This is for Kanji type printers.
This specifies that printing should begin on page 2.
Note: This option is not valid for pass-through printers, such as PostScript and the pass-through option.
This specifies that the whole page coordinate system is used. This option is generally used on laser printers that cannot print to the edge of the page. The other option is -G ! and this specifies that a Print Page Coordinate system is used.
The -h flag is used with the -f flag to specify the title of text for the pr filter.
This command uses Mike as the hostname on the header page.
This indents each line 5 spaces when the file is printed.
Note: The -w option should generally be used to allow the line to print properly.
This option causes the file to be printed in the font specified by fontid.
Note: This option overrides the -p and the -s flag settings, and is used with printers that have fixed fonts defined in the customized virtual printer.
This option causes the job to be sent with no initialization to the printer. Other options of the -j flag are 1=Full initialization, 2=Emulator selection only.
This option keeps the printer from being restored at the end of print job. The -J + is used for normal restore at end of job.
This causes this file to be printed in blue. Available colors are usually red, blue, black and green.
This causes the printer to print in condensed mode. The -K ! is used to turn off condensed mode if it is the default.
This sets the page length to 60 lines when the file is printed. This should include margins.
This sets the job to wrap long lines to the next line. The -L ! is used to truncate the lines.
This sends a message to the operator and the job will wait for him to respond, unless write to operator fails and then it will print.
This sends an mfile to the console when the job is ready and will wait for the response, unless the write to the operator fails (where mfile is a file with a message in it).
This command notifies the user when the print job completes, unless -D flag is used.
This specifies that 7 copies of the file are to be printed.
Specifies that manual paper feed is to be used. Other flags are 2=Continuous forms, 3=Sheet feed.
This specifies the pitch to be used in printing the file.
Note: This flag is affected by the -K and -W and is overridden by the -I flag.
This specifies printing of the file be sent to lp2 device name.
Note: If more than one device exists for a queue, than the correct syntax would be lp2:qdevice instead of lp2.
This specifies that the fast font be used (which is the fastest normal mode). The other options for -q are 1=Draft Quality, 2=Near Letter Quality and 3=Enhanced Quality.
This causes the file to be removed after the print job has completed.
This command queues the job with a priority of 20. The maximum that can be set by the user is 20 and 30 for the root.
This prints the file in named type style. Other examples are prestige or elite. The specified type style must be defined in the customized virtual printer.
This specifies if high speed printing is wanted. The -S ! overrides this setting.
This specifies that a 5 line top margin should be used.
This uses MyJob as the print job title when checking status and so on.
This specifies the envelope tray as the input tray. Other options are 1=Primary, 2=Alternate.
This specifies that printing is performed in a single direction. The -U ! specifies bidirectional printing.
This sets the lines per inch to 6.
This specifies that vertical printing is desired. To turn it off use the -V !.
This sets the page width to 85, if width is possible.
This specifies that double wide print is wanted. The -W ! is used to turn it off.
This specifies that a line feed is added for each carriage return. Other options are:
This specifies the code page as 850.
This specifies that double strike is used to print. The -y ! overrides this setting.
This specifies duplex printing for the file. Other options include:
This specifies portrait upside-down printing for the file. Other options are:
This specifies that no form feed be sent to the printer. To turn off the option -Z + specifies that a form feed be sent.
Note: If -Z ! is used there is a chance that two jobs may print on the same page.
The enq program is a general purpose program that accepts requests for printing, cancel requests, alters the priority of a job and displays the status of print queues and print devices. The enq command is used to print files to specified queues.
# enq filenameThis causes the file called filename to be submitted to the default queue, usually called lp0 (the first stanza in the /etc/qconfig file; the easiest way to check is to enter enq -q which will display the status of the default queue). There are several flags associated with the enq command and are entered in the following form:
# enq -flag filename
Displays the status of only the job number specified.
Changes priority of the job number specified to num.
Displays the status of all the queues.
Specifies burst pages, no headers and no trailers.
Specifies always headers and trailers on groups. The first letter is for the header, the second for the trailer (n=never, a=always, g=group).
Allows the file to be edited while it is printing, since the file is copied to /usr/spool/qdaemon.
Specifies that the mail command be used instead of the write. This is generally the preferred method with PostScript printers, since it will return error, job completion and printer messages.
The -L option returns the long form of the status commands.
The message is displayed to the operator just before the job is queued. The operator must respond to the message in order to print the file.
The mfile is a message file that is sent to the operator right before the job is queued. The operator must respond for the job to print.
This command prints the file, and notifies the user when the job has completed.
Prints the file 5 times.
Allows a flag from the backend to be entered on the command line as an enq flag. enq simply passes the flag to the backend to process.
Sends the file to the queue lp2.
Sends the file to the queue lp2 and the queue device qd2.
Prints the status of the default queue.
Prints the status of the queue lp2.
Prints the file and then removes the file.
Enqueues the file at a priority of 20 (normal=15, max 20 or 30). See enq -a for changing priority after enqueued.
Labels output for name, normally labelled for submitter.
Enqueues the file and puts My Header as the title on the header page.
This command displays the print status for the user mike on the default queue.
This command kills all the print jobs on the default printer for the user mike.
This displays the status for the default queue every thirty seconds.
This cancels print job number 3.
This cancels all of the jobs on the queue lp2.
The -Y is used to ignore the rest of the line. It is useful for forcing the qdaemon to redigest the qconfig and verifying that lp2 is in /etc/qconfig.
This enqueues the file to the remote queue and specifies the originator as jay.
For more information see the enq command under InfoExplorer.
Options are: -A (all), -L (long form), -# jobnumber, -P queue, -q default queue, -u username, -w seconds (displays status every number of seconds).
Here are some examples:
This command displays the status for all of the queues.
This command displays the status for queue lp1 job number 16 and ownername sam.
This command displays the status for the default print queue.
This command displays the long status of all queues until empty while updating the screen every 5 seconds.
This cancels print job number 15. This command can also use the queue name (-P lp2) or a global kill (-X).
This cancels job number 16 of the queue lp1.
This command changes the priority of job 16 to a priority of 20.
This brings the queue lp0:lp0 to the ready state. Other flags include:
This kills all of the users jobs on the queue lp2, if root all jobs are killed.
This brings the qdaemon down after all current jobs complete.
This brings the queue lp2 down after the current job completes.
Current jobs on the queue lp2 are deleted, all jobs remain in the queue and are run again when the printer is brought back up.
This command will put queue lp1 into the down state after the current job has finished printing. If there is more than one device for that queue the command is enq -P lp1:lp1 -D.
This command stops the qdaemon after all the current jobs finish printing. This is the preferred method of stopping the qdaemon.
This kills all jobs in the queue device asc1 only and requeues the killed job to be run again when the queue device is brought back up.
This brings the queue device asc1 up.
Note: enq -U -P lp1 can be used when there is only one queue device in that queue.
Note: There is no command to cancel jobs from the remote host. In this case, the way to cancel a job is to use these preceding commands on the local host with a telnet, rexec or rsh command.
The flow of the AIX queuing system is shown in
Figure - Flow of the AIX Version 3 Queueing System.
Figure: Flow of the AIX Version 3 Queueing System
This diagram also shows a status file /var/spool/lpd/stat and the directory where job request information is temporarily stored .
The files below are most of the files that are used by the printing subsystem. These files are generally manipulated by the commands or by SMIT. Therefore it is rarely necessary to edit them.
The following list describes the purpose of these files and directories.
Note: These daemons are started with startsrc which is a part of the srcmstr daemon.
We will discuss an example how to configure a local printer. First, you have to read the documentation for your printer. You may need printer-specific information, such as default values and options, to configure the printer. You must have root authority to do the following procedure.
For example if you want to add a printer of the type 4202-III XL on a host for example named pippin, do the following:
Add a Printer/Plotter
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[TOP] Entry Fields
printer/Plotter type 4202-3
printer/Plotter interface parallel
Description IBM 4202 Model 3
Parent adapter ppa0
* PORT number []
Type of PARALLEL INTERFACE [standard]
printer TIME OUT period [60]
STATE to be configured at boot time [available]
The following attributes have meaning only
when the printer/Plotter is not used with
a Print queue:
Number of LINES per page [66]
Number of COLUMNS per page [80]
Number of columns to INDENT [0]
Send all characters to printer UNMODIFIED no
Send BACKSPACES yes
WRAP CHARACTERS beyond the specified width no
Send FORM FEEDS yes
Send CARRIAGE RETURNS yes
Send LINE FEEDS yes
Add CARRIAGE RETURNS to LINE FEEDS yes
Convert lowercase to UPPERCASE no
EXPAND TABS on eight position boundaries yes
Return on ERROR no
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
lp0 Available
Once a printer/plotter device has been created and made available, making a virtual printer through SMIT will create the queue, the queue device and the virtual printer itself. A virtual printer is a definition of what the piobe should do to format a file correctly for the attached printer. The files that are used to create the virtual printer are in /usr/lpd/pio/predef and the customized version is then copied to /var/spool/lpd/pio/custom which is digested into the /var/spool/lpd/pio/ddi directory.
The advantage of having a virtual printer is that it is now very easy to customize and change the parameters used to format the output.
This section of SMIT is different from the rest in that it prompts for answers one at a time and doesn't use the normal selection menus.
Virtual Printers
Move cursor to desired item and press Enter.
Add a Virtual Printer
Change / Show Characteristics of a Virtual Printer
Remove a Virtual Printer
No Description
1 Printer or Plotter Attached to Host
2 Printer or Plotter Attached to Xstation
3 Printer or Plotter Attached to ASCII Terminal
4 Network Printer (Hewlett-Packard JetDirect)
Enter number from list above (press Enter to terminate): -> 1
Enter device name (or, ! to exit): -> lp0
4202 Model 3 Proprinter III XL
Header pages wanted? (n=none; a=each file; g=each job): -> (n) n
Trailer pages wanted? (n=none; a=each file; g=each job): -> (n) n
Enter print queue name: -> (lp0) lp0
Should this queue be the default queue? -> (y) n
4202-3 configured for print queue lp0
Press Enter to continue.
Notes: Queue names may contain numbers but the first character must be a letter.
Once a default queue has been selected, it will no longer be prompted for, if adding multiple data streams for the same printer.
Any emulation bypassed by entering a ! at the prompt can be added later using the same option. This means some emulations can be left to a later date on which the emulations that are already defined must also be bypassed with a !.
The previous commands used to create a local printer creates the queue and queue device in the /etc/qconfig file, each with the same name.
This is the contents of your /etc/qconfig file:
bsh:
device = bshdev
discipline = fcfs
bshdev:
backend = /bin/sh
lp0:
device = lp0
lp0:
file = /dev/lp0
header = never
trailer = never
access = both
backend = /usr/lib/lpd/piobe
The purpose of a queueing system is to maintain a queue of jobs that are waiting for their turn to run. Usually, the jobs print hardcopy.
Another common use for queueing is batch processing. Having users submit jobs to a batch shell can help level system load by assuring that certain types of jobs are run via a queue and thus, one at a time.
This concept could be applied to a software development shop where a great deal of compiling goes on. In this case, a shell is used as the backend program and the first stanza of /etc/qconfig file bsh stanza is used.
Now we can check the status of the printer with the command qchk.
# qchk
queue Dev Status Job Files User PP % Blks Cp Rnk
------- ------ --------- ---- ---------------- ------ -- -- ---- -- ---
bsh bshde READY
# qchk -A
queue Dev Status Job Files User PP % Blks Cp Rnk
------- ------ --------- ---- ---------------- ------ -- -- ---- -- ---
bsh bshde READY
lp0 lp0 READY
# qprt -Plp0 /usr/lpp/bos/README
# qprt -Plp0 /u/bert/myfile
# lpr -Plp0 /etc/passwd
# ls /u/bert | qprt -P lp0
# qchk -A
queue Dev Status Job Files User PP % Blks Cp Rnk
------- ------ --------- ---- ---------------- ------ -- -- ---- -- ---
bsh bshde READY
lp0 lp0 RUNNING 3 /usr/lpp/bos/README root 56 1 1
QUEUED 4 /u/bert/myfile root 3 1 1
QUEUED 5 /etc/passwd root 1 1 1
... and so on
# cd /var/spool/lpd/qdir
# ls
00root:lp0
01root:lp0
02root:lp0
03root:lp0
# pg 00root:lp0
175
#@%!: 0 0 15 0 744493860
56 1 3 3
root 0
REAL_USER=rootn,auditUSRENVIRON:msg/prime/%Netc/objreposZ=CST6C
DT-Plp0
/usr/lpp/bos/README
root
pippin.itsc.austin.ibm.com
0
/usr/lpp/bos/README 0
# cd /var/spool/lpd/stat
# ls
_dev_lp0
numfile
p.lp0.lp0
pid
s.bsh.bshdev
s.lp0.lp0
# pg numfile
178
# pg pid
8798
# pg p.lp0:lp0
12341
Wed Aug 04 14:51:01
1993""root"root" /usr/lpp/bos/README
"lp0" lp0 -Plp0
# qcan -X
/u/bert/myfile /etc/passwd ls /u/bertHowever, the job asked by qprt -Plp0 /usr/lpp/bos/README will not be cancelled, because it is always running.
Remote printing allows a user on one machine to use a printer on a network attached machine as if it were a local printer. This is a feature of the AIX Printing Subsystem and TCP/IP.
Remote printing is issued from the client system and is transferred by the Remote Printing Backend to the network where it is picked up by the server system and printed.
The server is for example the host named pippin and the client is the host named bruce.
Add a Remote queue
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
* NAME of queue to add [remq]
ACTIVATE the queue? yes
Will this become the DEFAULT queue? no
Queuing DISCIPLINE first come first serve
ACCOUNTING FILE pathname []
* DESTINATION HOST for remote jobs [bruce]
* Pathname of the SHORT FORM FILTER for queue [/usr/lpd/aixshort]
status output
* Pathname of the LONG FORM FILTER for queue [/usr/lpd/aixlong]
status output
* Name of QUEUE on remote printer [lp0]
* NAME of device to add [lp0]
* BACKEND PROGRAM pathname [/usr/lpd/rembak]
This will add an entry in file /etc/hosts.lpd on pippin machine. This entry is the name of the client host: bruce.
# qprt -P remq /fred/test2
# qprt -P remq /etc/passwd
# qchk -A
queue Dev Status Job Files User PP % Blks Cp Rnk
------- ------ --------- ---- ---------------- ------ -- -- ---- -- ---
bsh bshde READY
remq lp0 READY
remq lp0 RUNNING 179 /fred/test2 root@br 1 1 1
remq lp0 QUEUED 180 /etc/passwd root@br 1 1 2
# cd /var/spool/lpd/qdir
# ls
00root@bruce:lp0
01root@bruce:lp0
When the queueing system shows one or more queues in DEV_WAIT, when qdaemon repeatedly dies, or when your queueing subsystem is completely down, you can use the following method to clear and restart the queueing system. If you find that this procedure must be constantly run to keep your queueing system in working order, you may have a more serious problem with your configuration. Work with your local support team to resolve this situation.
To clear the queueing system, you will need to stop the qdaemon process and check that the /var file system is not full. Then, clear the directories and start the qdaemon process again.
# lpstat
To cancel print jobs, enter:
# enq -x <job number>
# stopsrc -s qdaemon
# ps -eaf | grep qdaemon # ps -eaf | grep pio
Only one line of output should be displayed for each of the above commands (the two grep commands, in fact). If this is the case, skip to step 6.
If there was more than one line of output, note the process ID (second column of output) for each process except "grep qdaemon" and "grep pio" (process names are in the last column).
# kill -9 <process ID>
Run the command for each process ID you noted above, replacing
<process ID> with the process ID.
If your print job exists in one of the following directories, make a copy of
it and place it in /tmp; you can print it when the queueing system is
running again (in these directories, the files will have unfamiliar system
names): /var/spool/qdaemon
/var/spool/lpd
Enter the df command and look in the %used column for /var to see if the file system is too full. Free or increase space in the file system as necessary.
# cd /var/spool/lpd/qdir
# rm *
# cd /var/spool/lpd/stat
# rm *
# cd /var/spool/qdaemon
# rm *
Continue with the following steps if you are having trouble with remote queues or with lpd. Otherwise, skip to Step 16.
# cd /var/spool/lpd
# rm *(This will not remove the subdirectories, so you will see normal error messages).
# startsrc -s qdaemon
The queueing system should start normally. If some queues are still down, try to bring them up with enable <qname> command.
This status can occur when:
Normal recovery: To recover from a DEV_BUSY state, you would have to wait until the queue or application has released the printer device or kill the job or process that is using the printer port.
This status means that the queue is waiting on the printer because the printer is offline, out of paper, or jammed, or the cable is loose, bad, or wired incorrectly.
Normal recovery: To recover from a DEV_WAIT state, you will have to correct the problem that caused it to wait. Check to see if the printer is offline, out of paper, jammed, or loosely cabled. Sometimes the jobs have to be removed from the queue before the problem can be corrected.
Also, DEV_WAIT can be caused by improper flow control to the printer, particularly with XON/XOFF software control. Check in SMIT to see if you are using the proper flow control (XON/XOFF or DTR pacing) with the printer.
Finally, bad or miswired cabling can cause a DEV_WAIT situation. Usually, you cannot recover from this situation, except by replacing the cable with a known working cable.
A queue that is in DEV_WAIT state for longer than TIME OUT seconds will go into a DOWN state. See DOWN for more information on the TIME OUT value and the DOWN state.
This status is set when the device driver cannot communicate with the printer (CD or CTS dropped or is low) after TIME OUT seconds. The TIME OUT value can be set through SMIT and it indicates the amount of time, in seconds, that the queueing system waits for a printer operation to complete.
A queue will usually go into a DOWN state after it has been in the DEV_WAIT state. If a queue goes directly into the DOWN state then either the TIME OUT value is too small or there might be cabling problems. Usually, this situation occurs when the printer device driver cannot tell if the printer is present due to absence of correct signalling. However, some printers may not have the capability to signal the queueing system that it is off-line, but signals that it is off (that is drops CTS if an lp, or CD if a tty).
If the printer device is off, the the queue will go DOWN. Also, the system administrator can intentionally bring a queue to the DOWN state with the queueing commands (qadm, disable, enq and so on). This may be necessary for system maintenance.
Normal recovery: To recover from a DOWN state, correct the problem that has brought the queue down and then have the system administrator bring the queue back up (that is the qadm, enable or enq commands with appropriate flags). The queue must be manually brought up before it can be used again.
This status is set when the backend program is waiting on the operator the change paper, change forms, and so on. This is usually software related (that is the write command).
Normal recovery: To recover from a OPR_WAIT state, respond appropriately to the request that is made by the queueing system.
This status is set when a print file is queued and is waiting in line to be printed.
This is the status of a queue when everything involved with the queue is ready to queue and print a job.
This status occurs when a print file is printing.
This status is when a user creates a queue on a device file that another queue is using and its status is DEV_WAIT. The queue cannot get a status from the printer device (lp0) when it is on hold (DEV_WAIT).
Normal recovery: To correct this, bring down the other queue or fix the problem with the printer (paper our, jammed, off-line, and so on). Bring the new queue down and then back up so that the queue will register as READY.
This status is set when the backend has connected to the remote host.
This status is set when the backend is contacting the host to which it will send the print job.
This is set when the backend is in the process of establishing the connection to the network.
This is set when the backend is sending the print job to the remote host.