[cups.bugs] [HIGH] STR #1970: lpoptions unable to set a basic printer setting

Kurt Pfeifle kpfeifle at danka.de
Fri Sep 8 17:59:23 PDT 2006


Ryan Lovett <bugs at spacecoaster.org> wrote (Saturday 09 September 2006 00:59):

> 
> [STR New]
> 
> Now I have discovered that /etc/cups/lpoptions seemingly has no effect, but
> you can set printer options after printer creation using lpadmin.

Yes, *and* you can set them *during* creation with lpadmin.

> What is 
> the role of /etc/cups/lpoptions ? 

It's the systemwide default option setting, used in case the user 

 - does neither use a "-o option=value" on the commandline, or
 - has no $HOME/.lpoptions file containing a setting for the option


I'll paste my last reply here (for Google users):

---------------------------------------------------------------------

A commandline of

  lpoptions -p printername -l

will result in lines build along the scheme 

  "a/b c d: e f *g h i"

where:

  "a"            - is the (internally used) option name used by the
                   system, and required on the commandline; 
  "b c d"        - is the (user visible) "translated" option
                   (displayed by GUI print dialogs, like KDE's
                   'kprinter', or 'xpp' or 'gtklp'
  e, f, g, h, i  - selectable values for the options; the one
                   currently used default one is denoted with an 
                   asterisk ('*').
  
Based on that info, you may get from this command

  lpoptions -d pr1 -l

a line like:

  Duplex/2-Sided Printing: *None DuplexNoTumble DuplexTumble

Now you can use

   lpoptions -p pr1 -o Duplex=DuplexNoTumble

to set your impersonated user's default options into $HOME/.lpoptions
for printer "pr1". Use (as root!).

   lpoptions -p pr1 -o Duplex=DuplexNoTumble

to set systemwide defaults for printer "pr1" into /etc/cups/lpoptions. 
Use (as root!).

   lpadmin -p pr1 -o Duplex=DuplexNoTumble

to set defaults for PPD file used by printer "pr1" (that is, the file
located at /etc/cups/ppd/pr1.ppd). This will be used by remote clients
who picked up the local printer via browsing or polling.

Use

   lpr -p pr1 -o Duplex=DuplexTumble /path/to/printfile
   lp -d pr1 -o Duplex=DuplexTumble /path/to/printfile

to print a job with a Duplex setting that deviates from the default
option setup. 

* "lp -o something" overrides any other settings which may or may 
  not be stored in $HOME/.lpoptions or /etc/cups/lpoptions or in
  /etc/cups/ppd/pr1.ppd

* A user's $HOME/.lpoptions setting overrides the systemwide default
  in /etc/cups/lpoptions or in /etc/cups/ppd/pr1.ppd

* A setting in the PPD file /etc/cups/ppd/pr1.ppd will be used if 
  not specified otherwise.

> The options defined there were not used 
> by lpr when I submitted a job, despite what the man page says.

Please check again, in the light of what I have outlined above.
What do the commands

  cat /etc/cups/lpoptions
  cat $HOME/.lpoptions

show? You can always check what "lpr" without any options will be
using by issuing

  lpoptions -p printername -l

and looking for the '*'-marked values (valid only for the user who
runs the lpoption command -- may be different if you use it as root!).


Cheers,
Kurt





More information about the cups mailing list