Configuration File, Defaults and Overrides

LPRng Reference Manual: 24 Sep 2004 (For LPRng-3.8.28)
Prev |  | Next

# Chapter 14. Configuration File, Defaults and Overrides

Options used:

- allow_getenv FLAG use GETENV environment variable

The LPRng options are obtained as follows:

- The compile time defaults. These are in the `LPRng/src/common/vars.c` file.

- If the LPRng software has been compiled with the regression testing GETENV option enabled, the configuration information in the file specified by the LPD_CONF environment variable will be used. This can only be used if you are not setuid ROOT or as ROOT as it opens severe security loopholes.

- The file specified by the config_file compile time option, usually `/etc/lpd.conf` or `/usr/local/etc/lpd.conf`, and referred to a the `lpd.conf` file. If the config_file option value has the form `|/pathname`, then `/pathname` must be an executable program and will be run with the standard set of filter options. It must write configuration option values to its STDOUT and exit with a 0 status.

- In order to protect system security, the `lpd.conf` (and the `printcap`) file should be read only.

- If the require_configfiles option is set in the compile time options, then the preceeding step must be successful, i.e. - there must be a configuration file or the program must execute and exit with a 0 status.

- If a printer or spooling operation is done, then the values in the `printcap` entry for the spooler are used to override the default and `ifhp.conf` file values.

# 14.1. Configuration File Format

The configuration file format is similar to a the fields of a printcap entry with the difference that the leading colon is optional and there can only be one option per line:

        # comment
        # set option value to 1 or ON
        ab
        :ab
        # set option value to 0 or OFF
        ab@
        :ab
        # set option value to string
        str=name

During system installation the LPRng software processes the default values in the `LPRng/src/common/vars.c` file and generates a sample `lpd.conf` file that has the format:

        # Purpose: always print banner, ignore lpr -h option
        #   default ab@ (FLAG off)
        # Purpose: query accounting server when connected
        #   default achk@ (FLAG off)
        # Purpose: accounting at end (see also af, la, ar, as)
        #   default ae=jobend $H $n $P $k $b $t  (STRING)
        # Purpose: name of accounting file (see also la, ar)
        #   default af=acct  (STRING)

        # change:
        # --- we change the af value to none, i.e. - no accounting
        # --- file by default
        af=

You can change option values by editing the file as shown above then then to force the lpd server to use the new options, use the `lpc reread` command.

Prev | Home | Next
Job Identifier |  | Legacy Compatibility