qconfig File

Purpose

Configures a printer that queues in a system.

Description

The /etc/qconfig file describes the queues and devices that are available for use by both the enq command and qdaemon command. The enq command places requests on a queue, and the qdaemon command removes requests from the queue and processes them. The qconfig file is an attribute file.

Some stanzas in this file describe queues, and other stanzas describe devices. Every queue stanza must be immediately followed by one or more device stanzas in the file. The first queue stanza describes the default queue. Unless the LPDEST or PRINTER environment variable is set, the enq command uses this queue when it receives no queue parameter. If LPDEST contains a value, that value takes precedence over the PRINTER environment variable. Destination command-line options always override both variables.

The name of a queue stanza must be from 1 to 20 characters long. The following fields are the fields in the queue stanza of the qconfig file:

Table 1. Fields in the queue stanza of the qconfig file
Field Definition
acctfile Identifies the file that is used to save the print command accounting information. The default value is FALSE that indicates suppress accounting. If the named file does not exist, accounting is not done.
device Identifies the symbolic name that refers to the device stanza.
discipline Defines the queue that serves the algorithm. The default value is fcfs that means first-come-first-served. The value sjn means shortest job next.
up Defines the state of the queue. The default value TRUE indicates that the queue is running. The value FALSE indicates that it is not running.
recovery_type Enables the user to specify a recovery option when a print queue goes down. By default, the queue remains in the down state and requires user intervention.
Other options can be specified by using the following values:
runscript <PathName>
A user-defined script is run when the queue goes down. The actions that are taken by the script are left to the discretion of the system administrator.
retry -T <delay> -R <retries>
The queue stays down for the period that is specified in delay (expressed in minutes). After the specified period, the queue is taken back up and the job is run again. This procedure is repeated up to the number of retries specified in the retries variable. This feature is useful in cases where job failures are due to temporary conditions likely to be resolved within the lapse of a certain time period. For example, a paper out condition or a temporary network glitch or slowdown.
sendmail <username>
The specified user receives mail when the queue goes down notifying the user that the specific printer is down.
Note: The queue name lp is a Berkeley Software Distribution (BSD) standard reserved queue name and must not be used as a queue name in the qconfig file.

The following list shows some of the fields and their possible values that appear in the qconfig file for remote queues:

Table 2. Fields in qconfig file
Item Description
host Indicates the remote host where the remote queue is found.
s_statfilter Specifies the short version filter that is used to translate the remote queue status format. The following are possible values:
/usr/lib/lpd/bsdshort
Berkeley Software Distribution (BSD) remote system
/usr/lib/lpd/aixv2short
RT remote system
/usr/lib/lpd/attshort
American Telephone and Telegraph ( AT&T) remote system
l_statfilter Specifies the long version filter that is used to translate the remote queue status format. The following are possible values:
/usr/lib/lpd/bsdlong
BSD remote system
/usr/lib/lpd/aixv2long
RT remote system
/usr/lib/lpd/attlong
AT&T remote system
rq Specifies the remote queue name. In a remote print environment, the client configuration must specify the remote queue name or the server. Using the default remote queue name might cause unpredictable results.

If a field is omitted, its default value is assumed. The following screen shows the default values for a queue stanza:

discipline   = fcfs
up           = TRUE
acctfile     = FALSE
recovery_type = queuedown 

The device field cannot be omitted.

The name of a device stanza is arbitrary and must be from 1 to 20 characters long. The following fields are the fields on the device stanza of the qconfig file:

Table 3. Fields in device stanza
Field Definition
access Specifies the type of access the backend has to the file specified in the file field. The value of access is write if the backend has write access to the file or both if it has both read and write access. This field is ignored if the file field has the value FALSE.
align Specifies whether the backend sends a form-feed control before starting the job if the printer was idle. The default value is TRUE.
backend Specifies the full path name of the backend, followed by the flags and parameters, if any, to be passed to it. The path names that are most commonly used are /usr/lib/lpd/piobe for local print and /usr/lib/lpd/rembak for remote print.
feed Specifies either the number of separator pages to print when the device becomes idle. The default value is never that indicates that the backend is not to print separator pages.
file Identifies the special file where the output of the backend is to be redirected. The default value FALSE indicates no redirection and that the file name is /dev/null. In this case, the backend opens the output file.
header Specifies whether a header page prints before each job or group of jobs. The header field can take the following values:
  • never: Indicates that no header page is printed before each job or group pf jobs. This option is the default value.
  • always: Indicated that a header page is printed before each job.
  • group: Indicated that a header page is printed before each group of jobs for the same user.
In a remote print environment, the default action is to print a header page and not to print a trailer page.
trailer Specifies whether a trailer page prints after each job or group of jobs. The trailer field can take the following values:
  • never: Indicates that no trailer page is printed before each job or group pf jobs. This option is the default value.
  • always: Indicated that a trailer page is printed after each job.
  • group: Indicated that a trailer page is printed after each group of jobs for the same user.
In a remote print environment, the default action is to print a header page and not to print a trailer page.

The qdaemon process places the information that is contained in the feed, header, trailer, and align fields into a status file that is sent to the backend. Backends that do not update the status file do not use the information that it contains.

If a field is omitted, its default value is assumed. The backend field cannot be omitted. The following screen shows the default values for a device stanza:

file    = FALSE
access  = write
feed    = never
header  = never
trailer = never
align   = TRUE
The enq command automatically converts the ASCII qconfig file to binary format when the binary version is missing or older than the ASCII version. The binary version is found in the /etc/qconfig.bin file.
Note: The qconfig file must not be edited while there are active jobs in any queue. Anytime the qconfig file is changed, jobs that are submitted before the change will be processed before jobs submitted after the change.
To improve the scalability of the AIX printer subsystem, perform the following steps:
  1. Stop the AIX printer subsystem by entering the following command:
    #stopsrc -s qdaemon
  2. Start the AIX printer subsystem by entering the following command:
    #startsrc -s qdaemon -e printer_scalability=ON
  3. Start the lpd daemon by entering the following command:
    #startsrc -s lpd -e printer_scalability=ON
  4. Set the printer_scalability environmental variable to ON by entering the following command:
    #export printer_scalability=ON

    The printer_scalability environmental variable is set only for the current session.

Notes:
  • To improve the scalability of the AIX printer subsystem, complete all the steps explained earlier. Failure to complete any of the steps might result in undefined behavior within the printer subsystem.
  • The optimal limit for the number of queues that can be created to maintain the scalability of the AIX printer subsystem is 10,000.

Editing includes both manual editing and use of the mkque, rmque, chque, mkquedev, rmquedev, or chquedev commands. It is recommended that all changes to the qconfig file be made by using these commands. However, if you want to edit manually, first issue the enq -G command to bring the queuing system and the qdaemon command to a halt after all jobs are processed. Then edit the qconfig file and restart the qdaemon command with the new configuration.

Examples

  1. The batch queue that is supplied with the system might contain the following stanzas:
    bsh:
      discipline = fcfs
      device = bshdev
    bshdev:
      backend = /usr/bin/ksh
     
    To run a shell procedure called myproc by using this batch queue, enter the following command:
    qprt -Pbsh myproc
    The queuing system runs the files one at a time, in the submitted order. The qdaemon process redirects standard input, standard output, and standard error to the /dev/null file.
  2. To allow two batch jobs to run at the same time, enter the following command:
    bsh:
      discipline = fcfs
      device = bsh1,bsh2
    bsh1:
      backend = /usr/bin/ksh
    bsh2:
      backend = /usr/bin/ksh
  3. To set up a remote queue bsh, enter the following command:
    remh:
      device = rd0
      host = pluto
      rq = bsh
    rd0:
      backend = /usr/lib/lpd/rembak
      
  4. To set a local queue such that an email is sent to user1@xyz.com when it goes down, enter the following command:
    ps:
           recovery_type = sendmail user1@xyz.com
            device = lp0
    lp0:
            file = /dev/lp0
            header = never
            trailer = never
            access = both
            backend = /usr/lib/lpd/piobe
    

Files

Table 4. Files
Item Description
/etc/qconfig Contains the configuration file.
/etc/qconfig.bin Contains the binary version of the /etc/qconfig file that is created by the digest command.
/dev/null Provides access to the null device.
/usr/lib/lpd/piobe Specifies the path of the local printer backend.
/usr/lib/lpd/rembak Specifies the path of the remote printer backend.
/usr/lib/lpd/digest Contains the program that converts the /etc/qconfig file to binary format.