PRINTER



Queues

[pic]

The purpose of the queuing system is to maintain a queue of jobs that are waiting for their turn to run (that is, use some system resource, like a printer or the CPU).

The queues also give control to the system administrator over the queuing mechanism. Therefore, the system administrator can perform tasks like canceling jobs on queues, changing priorities of jobs, and so forth.

A queue enables the sharing of resources in an ordered fashion.

The diagram above illustrates three important issues:

• One print queue can point to a number of printers (and it is the job of the

qdaemon to determine the next available printer to print on), for example,

Queue1.

• Users may submit their jobs to a number of different queues.

• A printer can have a number of different queues pointing to it, for example,

the printer /dev/lp1 is accessed by both Queue1 and Queue2.

[pic]

Local printing is implemented through a queuing mechanism. The user can issue one of the printer commands qprt, lp, lpr, or enq to submit a print job. Although a user can use any one of these four commands, the true entry point to the spooler is the enq command which is responsible for processing the job request, creating a job description file (JDF) and notifying the qdaemon of the new job.

The qdaemon process is running all of the time. The qdaemon maintains a list of all of the defined queues and monitors the queues for newly submitted jobs. qdaemon tries to process the job if the destination device is available, otherwise the job remains in the queue and qdaemon tries again later.

The flow of the queuing system shown:

• The printing command calls enq. enq checks to see if the queue name desired is a valid queue and all of the parameters are correct. If so, it continues, if not, an error message is returned to the user.

An entry is made in the /var/spool/lpd/qdir directory identifying the job to be run. If the printer command uses an option to indicate that a copy of the file is to be made, the copy is placed in the spool directory /var/spool/qdaemon.

• The qdaemon is notified of a new job in its qdir directory.

• When the queue is ready for the job, the qdaemon reads information from the /etc/qconfig file describing the queue.

• The qdaemon updates the /var/spool/lpd/stat file for the appropriate queue to show that the queue is now working on a new job.

• The qdaemon starts the backend program passing the file names and appropriate options on the command line.

• The back end determines the correct data stream characteristics and merges these with the actual file. The data stream characteristics are stored as virtual printer definitions in the /var/spool/lpd/pio/@local directory.

• The back-end program sends its data stream to the device driver for the appropriate printer.

When a file is spooled, a copy of that file is sent to the print spool directory,

/var/spool/qdaemon. The copy will remain in that directory until it is printed. This means that if you spool a file to the printer, a user could continue to make revisions to the original since the copy in the print spool directory will not be altered.

This ensures that the file that is sent to the printer gets printed in its original form, even if a user edits the original file that is on disk. Spooled files will take up disk space in /var until they are printed.

When a file is queued, one line of information is sent to the /var/spool/lpd/qdir directory which points back to the original file on disk. If revisions are made to the file on disk before it is pulled from the queue to print, the revised file is printed.

[pic]

qdaemon is controlled by /etc/qconfig

Use the startsrc command from /etc/inittab to manage qdaemon.

The qdaemon maintains a list of all of the defined queues and monitors the queues for newly submitted jobs.

The user can issue one of the printer commands qprt, lp, lpr, or enq to submit a print job.

The printing command calls enq, which checks to see if the queue name desired is a valid queue and all of the parameters are correct.

[pic]

For local printing the backend program is /usr/lib/lpd/piobe. For a remote printer, it is /usr/lib/lpd/rembak.

[pic]

The qdaemon program schedules jobs that have been enqueued.

It is a background process that is usually started at system IPL via the startsrc command run from /etc/inittab. qdaemon is controlled by the /etc/qconfig file. /etc/qconfig contains a stanza for each queue.

The stanza identifies any queue management options and points to a queue device stanza which identifies the destination printer, the formatting options, and the backend program. The backend program is called by qdaemon to actually process each request.

The backend program is determined by how the printer is connected to the RS/6000. For local printing the backend program is /usr/lib/lpd/piobe. For a remote printer, it is /usr/lib/lpd/rembak.

The back-end program uses printer attribute information to prepare the printer and format the data for output. It will also print header and trailer pages if they are enabled.

[pic]

The /etc/qconfig file is the key to customizing the queues. Although the file can be edited directly, it is recommended it be changed through high-level commands or via SMIT.

The /etc/qconfig file contains two types of stanzas:

• Queue stanza

This starts with the queue name, which can be up to 20 characters, followed by a colon. The queue name is used by the person submitting a job to indicate the desired queue. The first queue in the /etc/qconfig file is the default queue, which receives any job requests submitted without a specific queue name. A queue stanza points to a device stanza via the device= attribute in the queue stanza.

Attributes that can be found in the queue stanza include:

[pic]

The device stanza must contain an attribute that designates the backend program. It may also have an attribute that specifies the pathname of the logical device that serves the queue with which this device stanza is associated.

The function of the backend is to manage the printing of the actual job. It also produces the final data stream that goes to the printer. The most common backend program for local printing is piobe.

If different users desire different default printers, then the PRINTER variable can be set up on a per user basis. The PRINTER variable should be set to the queue that the user wishes to be their own default queue for example:

# PRINTER=ps ; export PRINTER

[pic]

Start a Print Job

This option starts a print job by submitting the job to a print queue.

Manage Print Jobs

This option puts you into a submenu which allows you to cancel jobs, show the status of jobs, prioritize jobs, hold and release jobs, and move jobs between print queues.

List All Print Queues

This displays a list of all the print queues and their associated printers.

Manage Print Queues

You can start and stop print queues, show the status of print queues and change the system's default print queue.

Add a Print Queue

This option adds a print queue to the system configuration and creates the associated queue device and printer device definition, if needed.

Add an Additional Printer to an Existing Print Queue

Adds another printer to an existing queue.

Change/Show Print Queue Characteristics

This option will provide access to screens that allow you to change the printer setup, default print job attributes, accounting file setup, and queuing discipline.

Change/Show Printer Connection Characteristics

Changes or shows printer communication and startup characteristics.

Remove a Print Queue

Removes a Print Queue from the system configuration. It also removes the associated spooler queue device and printer device definition. If a print queue has more than one printer associated with it, then all the printers are removed from the print queue.

Manage Print Server

Configures this machine as a print server. Allows you to control which clients have print access to this machine, list clients with print access, add and remove clients, and stop and start the server subsystem.

Programming Tools

Low-level utilities for manipulating databases and filters.

Change/Show Current Print Subsystem

Only one of the two print subsystems at the same time can be active. Per default after installation the AIX printer subsystem is active.

To show current print subsystem

# switch.prt -d

To change current print subsystem

# switch.prt -s AIX

or

# switch.prt -d SystemV

To check if binaries are correct linked

# ls -l /usr/bin/lpstat

/usr/bin/lpstat --> /usr/aix/bin/lpstat

or

/usr/bin/lpstat --> /usr/sysv/bin/lpstat

Printers and print queues can also be managed using the Web-based System Manager. To do so, use the fastpath wsm printers.

COMMANDS:

Command to submit the print job:

# qprt –Pps [-c] file

SMIT command to add a print queue:

# smit spooler

Add print access for a remote client:

# smit mkhostslpd

[pic]

In our example, assume that the printer is directly attached to our RS/6000 system. To configure a printer attached in this way, choose local.

Some applications contain their own print control mechanisms and thus require that a printer be configured without a queue. Use the SMIT fastpath smit pdp to define a printer without a queue.

[pic]

[pic]

If you do not have the software installed for your printer, you are prompted to insert the media to install the software first before configuring the device and the queue.

The choice of printer determines the queue (or the virtual printer) setup. For example, an IBM 4029 Laser Printer is capable of handling PostScript, ASCII, GL Emulation and PCL Emulation. The SMIT print spooling menus guide you through the creation of up to four separate queues which submit to the same printer.

[pic]

If the device driver is not already installed, SMIT prompts you to install the driver first before carrying on with the configuration.

After selecting a printer type, a pop-up window is displayed where the printer interface must be chosen. Possible values are parallel, RS232 and RS422. Some printers support multiple attachment methods.

Then, a list of installed adapters that support that method of attachment is presented.

[pic]

This menu varies depending on the characteristics of the physical printer. If the printer is capable of two or three different modes or emulations the system prompts you for a separate queue name for each emulation. Once these queues are created, they are sometimes referred to as virtual print devices.

Additional queues can be added to this printer after the initial queues are created.

[pic]

Once your system has the local queue set up, any user on that system can print. If the machine is networked, it can also provide printing for client machines by becoming a print server.

To set up a print server, you need to define the client machine names or IP addresses in /etc/hosts.lpd and then start the lpd daemon. Both of these tasks can be done through SMIT. To use SMIT, the fastpath to identify the client system is smit mkhostslpd.

The lpd daemon is controlled by SRC. You should use SMIT to start it however, because SMIT will also add entries to /etc/inittab to ensure that it is started on reboot. The fastpath for this screen is smit mkitab_lpd.

[pic]

This step is done on the print server. On this screen, enter the client machine's name or IP address. A plus sign ( + ) is also valid. It indicates that this RS/6000 is a print server to all machines.

[pic]

This step is done on the print server. The lpd daemon is controlled by the system resource controller (SRC). The commands startsrc and stopsrc can be used to control lpd. By using SMIT, an entry is placed in the /etc/inittab file to ensure that lpd is started each time the machine is booted.

[pic]

This step is done on the client machine. The procedure to add remote queue starts the same way as a local queue: smit spooler -> Add a Print Queue. This time select remote as the attachment type.

You will be prompted to determine if you want to perform any type of filtering or pre-processing to the print job before it is sent. Normally, Standard Processing is selected. This just sends the job to the printer server and the print server is responsible for processing the job.

[pic]

Only three lines are required to complete the queue set up. You must name your local (to the client) queue name. Then, provide the name of the printer server. Lastly, name the queue on the print server.

[pic]

There are three sets of commands for submitting, listing and cancelling print jobs. They come from either System V, BSD or IBM versions of UNIX and are all available in AIX. The commands have slightly different options.

To submit a print job to a queue, use either lp, lpr, or qprt. All jobs will go to the system default queue unless the PRINTER or LPDEST variables are set. You can also specify, on the command line, which queue to use. Use -d with lp or use -P with qprt and lpr.

The commands lp and qprt both queue without spooling by default. Specify the -c option if spooling is desired. The command lpr spools and queues by default. The -c option will turn off spooling with lpr.

To print multiple copies, with qprt use the -N # option, with lp use -n # option, and with lpr use just a dash followed by the number of copies ( - # ).

The lp, lpr and qprt commands create a queue entry in /var/spool/lpd/qdir and (depending upon the options specified) copy the file to be printed to the

/var/spool/qdaemon directory.

All the print commands, lp, lpr, and qprt, actually call the enq command which places the print request in a queue. enq can be used instead of the other commands to submit jobs, view job status, and so forth. To submit a job using enq:

$ enq -Pqueuename filename

Ordinarily your request is serviced by the first device on the queue that becomes available. However, if more than one printer services a queue, you can request a specific printer by using the name of the queue followed by a colon (:) and then the name of the printer. For example, if a system with one queue (ps) is serviced by two printers (lp0 and lp1) and a print job needs to be printed on the lp1 printer, use the command:

$ qprt -Pps:lp1 /home/team01/myfile

[pic]

Many of the print job control tasks require the user to supply a job number. The job number, along with other queue status information is available by checking the status of print jobs.

The fields from the qchk command are as follows:

Queue Queue name

Dev Logical device name for the queue

Status Status of the queue (READY, DOWN, WAITING, RUNNING, and so forth)

Job The job number assigned by the qdaemon

Files Files sent to the queue

User User who sent the print request

PP Number of pages printed

% Percent completed

Blks The number of 512-byte blocks the print job has been split into

Cp Copies of each job to be printed

Rnk Order on that queue

Other commands that can be used to view printer status include:

lpstat Shows status of all queues

lpq Shows status of the default queue

qchk -A Shows status of all queues

enq -A Shows status of all queues

qchk -W Shows status in wide-form mode. This is helpful if using long queue and device names, and 6-digit job numbers. This option is available with AIX V4.2.1 or later.

[pic]

Notes:

The four options contain attributes such as:

1. Printer Setup

Automatic mode switching to postscript

Paper size in trays and the manual feeder

Envelope size

ID of the font cards

Paper trays for header and trailer pages

Formatting flags for the header and trailer pages

Users to get the intervention messages

Flags prohibited for all print files

Mode in which to leave the printer at the end of the job

Width of printable area on header page

2. Default Print Job Attributes

Text print options such as emphasized print

Job processing options such as page number where printing should begin

Text formatting options such as top Margin and lines per page

Paper/Page Options such as page orientation

Header/Trailer Page such as separator pages

Messages/Diagnostics

3. Accounting File

Accounting file name

4. Queuing Discipline

Queuing discipline

[pic]

It is not possible to remove a queue containing jobs. The jobs would have to be removed first.

[pic]

Show Status of Print Queue - give output similar to qchk and lpstat

Stop a Print Queue - Runs the disable command

Start a Print Queue - Runs the enable command

Set the System's Default Print Queue - Reorders the /etc/qconfig file to ensure the default queue is the first queue in the file.

SMIT command to start the print subsystem:

# smit mkitab_lpd

The lpd daemon is controlled by the system resource controller (SRC).

If a system with one queue (ps) is serviced by two printers (lp0 and lp1) and a print job needs to be printed on the lp1 printer, use the command:

# qprt –Pps:lp1 /home/team01/myfile

To list jobs in a queue:

# qchk

Show status of all queues

# qchk –A

Show status in wide-form mode.

# qchk –W

Change Characteristics of a queue

# smit chpq

Removing a queue

# smit rmpq

SMIT command to manage queues:

# SMIT pqmanage

Command to show print queue status:

# lpstat

To enable a queue whose status is DOWN

# enable draft where the draft is a queue.

To disable a queue whose status is ready

# disable draft

SMIT command to managing print jobs:

# smit jobs

Canceling print jobs:

# smit qcan

Command to show new jobs priority

# qchk –L

Check to make sure qdaemon is running:

# lssrc –s qdaemon

# startsrc –s qdaemon

Ensure the queue are enabled

# lpstat or # qprt –A

# enable queuename

Hardware and Software Checklist for Printing Problems

To troubleshoot printing problems follow the following steps.

If something does not printout when using lp, lpr, or qprt then cat a file and redirect standard output to printer device file. (This actually by-passes the queuing system and helps to solve the problem)

# cat filename > /dev/lp0

Check for any output i.e any printout.

IF YES ( the problem is most probably software related.

A. Check “qdaemon” is running .if not, start it.

# lssrc –s qdaemon

# startsrc –s qdaemon

B. look at the content of /etc/qconfig to make sure it is not corrupt

C. Ensure the queue are enabled. If not enable them

# lpstat or # qprt –A

# enable queuename

D. Check to make /tmp and /var are not full

# df

IF NO (If it does not print, the problem is usually hardware related.

A. Check physical cable connection.

B. Check printer is ready to print (online).

C. Make sure there is no paper jam and there is paper in printer

LAB

ACTIVITY

1.Login as dcmcol and su to root and run root

smitty Print spooling Add a print queue local select printer manufacturere give printer model Name of the print queue Enter Key

2.To make the queue as system default queue

smitty Print spooling Manage print queue set the system’s default print queue give print queue name Enter Key

Through the command line

#qprt /tmp/print0

#qprt –Pquality /tmp/ptint0

#lp –dquality /tmp/print0

#lpr /tmp/print0

#lpr –Pquality /tmp/print0

#qchk -A

3.Changing Characteristic of a queue

Smitty print spooling change/show print queue characteristics queue name

Select default and give the detailed reply of the optiones as per requirement press Enter key

4.To stop print queue

Smitty print spooling Manage print queue stop a print queue Enter print queue name and press enter key

Through command line give

#disable

5.To see the status of the printer

Smitty print spooling Manage print queue show status of print queue press enter key

6.To manage print job

Smitty print spooling Manage print job Hold/release the print job press enter key

7.To start the print job

Smitty print spooling Manage print job start the print job press enter key

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download