Retaining printers.conf when updating CUPS

John A. Murdie john at cs.york.ac.uk
Thu Oct 19 09:46:17 PDT 2006


Brandon Allbery writes:
> > On Oct 13, 2006, at 9:14 , John A.Murdie wrote:
> > Ah, my problem is that I've never seen an 'lpoptions' (or
> > 'lpoptions.conf'?) file. (I don't have any classes yet - just
> > trying to get used to CUPS basic operation before I introduce
> > anything fancy.)
> > There's no 'lpoptions*' file in my CUPS 1.2.4 installation or its /
> > var directory (other than the lpoptions command and its manual page).
>
> It's just "lpoptions" and it's in the etc directory with
> printers.conf etc.  IIRC it's not actually necessary if it's empty,
> although cupsd will whine a bit if it doesn't exist.  (Presumably
> that answers my question as well, options set via the web interface
> must go straight into the ppd file if you don't have lpoptions.)
>
> --
> brandon s. allbery    [linux,solaris,freebsd,perl]     allbery at kf8nh.com
> system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
> electrical and computer engineering, carnegie mellon university    KF8NH

I've configured all my printers' options (default paper size, input tray etc) via the web interface, so that I fear that if the cupsd ever dies then all this will be lost and I'll have to start over! I had been assuming for a long time that the printer option settings got written back to the printers.conf file automatically - I'd seen the contents a few times, and mused that the file seemed rather small, but passed by!
One can't have the options written in to a printer's PPD file, as that serves for all printers of that type.

I see from the lptoptions(1) manual page that this command is not just for users to record their preferred defaults with but:

"When run by the root user, lpoptions gets and sets default options and instances for all users in the /etc/cups/lpoptions file."

and that the -l option:

"Lists the printer specific options and their current settings"

also something about the lpoptions configuration file that Brandon told me about:

"/etc/cups/lpoptions - system-wide defaults and instances created by the root user."

So, am I (is every CUPS administrator) meant to run something like:

# cd /etc/cups
# for printer in p1 p2 p3 p4 p5
do
lpoptions -l >> lpoptions
done
#

- though that doesn't put a section header for each printer - what is the correct thing to do here?

It's a pity that there is not an lpoptions(1) `-a' (all printers) option which with option -l would write the full expected contents of the /etc/cups/lpoptions file to standard output - then only:

# lpoptions -l -a > /etc/cups/lpoptions

would be necessary. Am I just missing something I should have read somewhere? I can't find anything in the CUPS book about all this (there is some mention of lpoptions(1) on pages 59 and 82, but the extra functionality for root and the -l option is not).

Mike (Sweet), any comments, advice?

John A. Murdie





More information about the cups mailing list