LPRng-HOWTO: /etc/lpd.conf Configuration File

Next Previous Contents

## 8. /etc/lpd.conf Configuration File

The values in the LPRng configuration file (default: `/etc/lpd.conf`) specify values for global options and default values for printcap options. See the man pages for `lpd.conf(5)` and `printcap(5)` for a complete list of configuration variables and their effects.

## 8.1 Configuration File Format

The LPRng distribution contains a template `lpd.conf` file which can be installed as `/etc/lpd.conf`. The configuration file has the following format:

    # Default version of the lpd.conf file
    # ae=jobend $H $n $P $k $b $t
    # allow_getenv
    # ar
    # architecture
    # as=jobstart $H $n $P $k $b $t
    # bk_filter_options=$P $w $l $x $y $F $c $L $i $J $C $0n $0h $-a
    # bk_of_filter_options=$w $l $x $y
    # bl=$-'C:$-'n Job: $-'J Date: $-'t
    # check_for_nonprintable
      check_for_nonprintable@
    # client_auth_command
    ...

The file uses the same notation for printcap entries, but does not use the : (colon) separator. A line starting with `#` is a comment.

To change the default value of an option, remove the comment character and edit the entry. In the above example, the default value (1 or TRUE) for `check_for_nonprintable` has been changed to 0 or off.

To force the `lpd` server to use the new options, use the `lpc reread` command.

As for printcap entries, the `%X` combinations are interpreted when a configuration entry is used for configuration or defaults, and can be used to do site and host dependent customization. This interpolation is done when the default or configuration value is used in a printcap context. See Missing Details for more information.

## 8.2 Obtaining Configuration Information

The location of the configuration file is compiled into the LPRng software. The `config_file` entry in the compilation defaults is normally set to search for configuration information in the following files:

    config_file=/etc/lpd.conf:/usr/etc/lpd.conf

To change any of the `config_file` specifications, the the `LPRng/src/common/vars.c` file will need to be modified and the LPRng software recompiled.

In addition, LPRng has a special debug mode. When compiled with the `-DGET_ENV` option enabled, this sets the value of the `allow_getenv` option to 1. LPRng can then use the value of the `LPD_CONF` environment variable instead of the compiled in `config_file` value. This is a possible security loophole, and should not be used when running SETUID ROOT or as ROOT. To enable this option, see the `TESTVERSION` comments in the `LPRng/src/Makefile`.

## 8.3 Useful Configuration Options

The following variables are used to set default behavior for the LPRng software, or are commonly used for configuration of LPRng operations.

### default_format

Default format for printing. Usually, `default_format=f`, but setting it to `default_format=l` will cause all files spooled by lpr to be spooled as binary files.

### default_permission=ACCEPT

The default permissions to use when checking for printing or other permissions.

### default_priority=A

The default priority for a print job.

### default_remote_host=localhost

The default `lpd` server host.

### default_tmp_dir=/tmp

The default directory for temporary files.

This option can be used to specify a default printer. If no value is given (default), the first printer in the printcap file will be used when no printer is specified.

### domain_name=domain.name

You will only need to set this if LPRng can't determine your hosts domain name itself. This is usually a desperation option when DNS or some other database system is not available.

Next Previous Contents