qconfig File

Purpose

Configures a printer queuing system.

Description

The /etc/qconfig file describes the queues and devices available for use by both the enq command, which places requests on a queue, and the qdaemon command, which 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 requires that one or more device stanzas immediately follow it 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 can be from 1 to 20 characters long. Some of the fields and their possible values that can appear in this file are:

Field Definition
acctfile Identifies the file used to save print accounting information. FALSE, the default value, indicates suppress accounting. If the named file does not exist, no accounting is done.
device Identifies the symbolic name that refers to the device stanza.
discipline Defines the queue serving algorithm. The default value, fcfs, means first-come-first-served. sjn means shortest job next.
up Defines the state of the queue. TRUE, the default value, indicates that the queue is running. FALSE indicates that it is not running.
recovery_type Enables users to specify a recovery option when a print queue goes down. By default, the queue remains in the down state pending user intervention.
Other options can be specified using the following values:
runscript <PathName>
A user-defined script is run when the queue goes down. The actions taken by the script are left to the discretion of the system administrator.
retry -T <delay> -R <retries>
The queue will stay down for the period of time specified in delay (expressed in minutes). Subsequently, it will be taken back up and the job will be retried. This is repeated up to the number of retries specified in retries. This is particularly 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 will receive mail when the queue goes down notifying him or her that the specific printer is down.
Note: lp is a BSD standard reserved queue name and should 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:

Item Description
host Indicates the remote host where the remote queue is found.
s_statfilter Specifies the short version filter used to translate remote queue status format. The following are possible values:
/usr/lib/lpd/bsdshort
BSD remote system
/usr/lib/lpd/aixv2short
RT remote system
/usr/lib/lpd/attshort
AT&T remote system
l_statfilter Specifies the long version filter used to translate 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 should specify the remote queue name or the server. Using the default remote queue name may cause unpredictable results.

If a field is omitted, its default value is assumed. The default values for a queue stanza are:

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

The device field cannot be omitted.

The name of a device stanza is arbitrary and can be from 1 to 20 characters long. The fields that can appear in the stanza are:

Field Definition
access Specifies the type of access the backend has to the file specified by 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, optionally followed by the flags and parameters to be passed to it. The path names 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 or the value never, the default, which indicates that the backend is not to print separator pages.
file Identifies the special file where the output of backend is to be redirected. FALSE, the default value, 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. A value of never, the default value, indicates no header page at all. always means a header page before each job. group means a header 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. A value of never, the default, means no trailer page at all. always means a trailer page after each job. group means a trailer page 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 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 it contains.

If a field is omitted, its default value is assumed. The backend field cannot be omitted. The default values in a device stanza are:

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 should not be edited while there are active jobs in any queue. Any time the qconfig file is changed, jobs submitted prior to the change will be processed before jobs submitted after the change.

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

Examples

  1. The batch queue supplied with the system might contain these stanzas:
    bsh:
      discipline = fcfs
      device = bshdev
    bshdev:
      backend = /usr/bin/ksh
     
    To run a shell procedure called myproc using this batch queue, enter:
    qprt -Pbsh myproc
    The queuing system runs the files one at a time, in the order submitted. 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 once, enter:
    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:
    remh:
      device = rd0
      host = pluto
      rq = bsh
    rd0:
      backend = /usr/lib/lpd/rembak
      
  4. 4. To set a local queue such that mail is sent to user1@xyz.com when it goes down, enter:
    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

Item Description
/etc/qconfig Contains the configuration file.
/etc/qconfig.bin Contains the digested, binary version of the /etc/qconfig file.
/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.