# classes.conf

The CUPS scheduler (cupsd) uses the /etc/cups/classes.conf file to store the list of available classes. This file contains only locally defined classes, not remote classes that are created automatically via browsing. Each directive is listed on a line by itself followed by its value. Comments are introduced using the number sign ("#") character at the beginning of a line.

While the class configuration file consists of plain text and can be modified using your favorite text editor, you should normally use the lpadmin(8) command, web interface, or any of the available GUIs to manage your classes instead. If you do choose to edit this file manually, you will need to stop the scheduler first, make your changes, and then start the scheduler to make them active.

## Accepting

### Examples

    <Class name>
      ...
      Accepting yes
    </Class>

### Description

The `Accepting` directive defines the initial state of the printer-is-accepting-jobs attribute. This state is also set by the `accept(8)` and `reject(8)` commands:

    /usr/sbin/accept classname
    /usr/sbin/reject classname

This directive must appear inside a `Class` or `DefaultClass` section.

## AllowUser

### Examples

    <Class name>
      ...
      AllowUser foo_user
      AllowUser @bar_group
    </Class>

### Description

The `AllowUser` directive adds a username or group name to the requesting-user-name-allowed attribute which can be set by the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p classname -u allow:foo_user,@bar_group

This directive must appear inside a `Class` or `DefaultClass` directive. This directive cannot be used with `DenyUser`.

## Class

### Examples

    <Class name>
      ...
    </Class>

### Description

The `Class` directive begins a class definition. Classes are added using the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p printername -c classname

## DefaultClass

### Examples

    <DefaultClass name>
      ...
    </Class>

### Description

The `DefaultClass` directive begins a class definition as the default server destination. The default server destination can be set using the `lpadmin(8)` command:

    /usr/sbin/lpadmin -d classname

Note that the server default destination settings can be overridden by the user's default destination settings which are normally set using the `lpoptions(1)` command.

## DenyUser

### Examples

    <Class name>
      ...
      DenyUser foo_user
      DenyUser @bar_group
    </Class>

### Description

The `DenyUser` directive adds a username or group name to the requesting-user-name-denied attribute which can be set by the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p classname -u deny:foo_user,@bar_group

This directive must appear inside a `Class` or `DefaultClass` directive. This directive cannot be used with `AllowUser`

## Info

### Examples

    <Class name>
      ...
      Info My Class
    </Class>

### Description

The `Info` directive defines the string for the printer-info attribute. It is normally set using the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p classname -D "My Class"

This directive must appear inside a `Class` or `DefaultClass` section.

## JobSheets

### Examples

    <Class name>
      ...
      JobSheets none,standard
    </Class>

### Description

The `JobSheets` directive specifies the default banner pages to print before and after a print job. In the above example, only a standard banner will print after each job. The `lpadmin(8)` command is normally used to set the default banners:

    /usr/sbin/lpadmin -p classname -o job-sheets-default=none,standard

If only one banner file is specified, it will be printed before the files in the job. If a second banner file is specified, it is printed after the files in the job.

The available banner pages depend on the local system configuration; CUPS includes the following standard banner files:

- `none` - Do not produce a banner page.
- `classified` - A banner page with a "classified" label at the top and bottom.
- `confidential` - A banner page with a "confidential" label at the top and bottom.
- `secret` - A banner page with a "secret" label at the top and bottom.
- `standard` - A banner page with no label at the top and bottom.
- `topsecret` - A banner page with a "top secret" label at the top and bottom.
- `unclassified` - A banner page with an "unclassified" label at the top and bottom.

This directive must appear inside a `Class` or `DefaultClass` section.

## KLimit

### Examples

    <Class name>
      ...
      KLimit 1234
    </Class>

### Description

The `KLimit` directive defines the value of the job-k-limit attribute. It is normally set using the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p classname -o job-k-limit=1234

This directive must appear inside a `Class` or `DefaultClass` section.

## Location

### Examples

    <Class name>
      ...
      Location Building 3321
    </Class>

### Description

The `Location` directive defines the string for the printer-location attribute. It is normally set using the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p classname -L "Building 3321"

This directive must appear inside a `Class` or `DefaultClass` section.

## CUPS 1.2 OpPolicy

### Examples

    <Class name>
      ...
      OpPolicy default
    </Class>

### Description

The `OpPolicy` directive sets the operation policy that is used for the printer. The `lpadmin(8)` command sets the current operation policy:

    /usr/sbin/lpadmin -p classname -o printer-op-policy=default

The default policy is named "default". All policies correspond to those defined using the cupsd.conf `Policy` section.

This directive must appear inside a `Class` or `DefaultClass` section.

## CUPS 1.2 Option

### Examples

    <Class name>
      ...
      Option name value
      Option scaling 100
      Option page-left 72
    </Class>

### Description

The `Option` directive specifies a default job template attribute value. It is mapped to `name-default` in the printer attributes and applied to jobs as `name`.

This directive must appear inside a `Class` or `DefaultClass` section.

## PageLimit

### Examples

    <Class name>
      ...
      PageLimit 1234
    </Class>

### Description

The `PageLimit` directive defines the value of the job-page-limit attribute. It can be set using the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p classname -o job-page-limit=1234

This directive must appear inside a `Class` or `DefaultClass` section.

## Printer

### Examples

    <Class name>
      ...
      Printer foo
      Printer bar
      Printer bleep
    </Class>

### Description

The `Printer` directive adds a printer to a class. Printers are added to a class using the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p printername -c classname

This directive must appear inside a `Class` or `DefaultClass` section.

## QuotaPeriod

### Examples

    <Class name>
      ...
      QuotaPeriod 604800
    </Class>

### Description

The `QuotaPeriod` directive defines the value of the job-quota-period attribute. Typical values are 86400 (1 day), 604800 (1 week), 2592000 (1 month), and 31536000 (1 year). It is set using the `lpadmin(8)` command:

    /usr/sbin/lpadmin -p classname -o job-quota-period=604800

This directive must appear inside a `Class` or `DefaultClass` section.

## CUPS 1.2 Shared

### Examples

    <Class name>
      ...
      Shared yes
    </Class>

### Description

The `Shared` directive defines the initial value of the printer-is-shared attribute. The strings yes and no correspond to the true and false values, respectively. The `lpadmin(8)` command sets the current state:

    /usr/sbin/lpadmin -p classname -o printer-is-shared=true

This directive must appear inside a `Class` or `DefaultClass` section.

## State

### Examples

    <Class name>
      ...
      State idle
    </Class>

### Description

The `State` directive defines the initial value of the printer-state attribute. The strings idle and stopped correspond to the IPP enumeration values 3 and 5, respectively. The `cupsenable(8)` and `cupsdisable(8)` commands set the current state:

    /usr/sbin/cupsenable classname
    /usr/sbin/cupsdisable classname

This directive must appear inside a `Class` or `DefaultClass` section.

## StateMessage

### Examples

    <Class name>
      ...
      StateMessage Ready to print.
    </Class>

### Description

The `StateMessage` directive defines the initial string for the printer-state-message attribute. The following are some example messages:

    StateMessage Connected to host_name...
    StateMessage Connecting to printer_queue on port port_number...
    StateMessage Network host host_name is busy; will retry in 30 seconds...
    StateMessage Class busy; will retry in 10 seconds...
    StateMessage Class is busy; retrying print job...
    StateMessage Print file accepted - job ID id_number.
    StateMessage Ready to print.
    StateMessage Waiting for job to complete

This directive must appear inside a `Class` or `DefaultClass` section.

## CUPS 1.2 StateTime

### Examples

    <Class name>
      ...
      StateTime 1133542425
    </Class>

### Description

The `StateTime` directive defines the UNIX time (seconds since Jan 1, 1970) for the last state change of the queue. It is mapped to the printer-state-change-time attribute.

This directive must appear inside a `Class` or `DefaultClass` section.