SuSE Linux: Versions since 7.2
PRINTER
.
If this environment variable is set to a value other than lp
,
this setting determines the default queue with highest priority.
If PRINTER
is set to lp
, it is
ignored by CUPS.
For traditional printing systems, there is an entry
in /etc/profile
or in /etc/SuSEconfig/profile
,
which normally sets PRINTER
to lp
.
As this would determine the default queue with highest priority,
it would be impossible to set any other default queue with the usual CUPS tools.
Furthermore, it is not possible to transfer the default queue on the CUPS server to the client machines because there could be several CUPS servers that broadcast several default queues to the client machines. For this reason, each client machine must have its own default queue setting. If there is no queue set to be the default queue, the first queue in alphabetical order is used by default.
From SuSE Linux 8.1 on, the basic information can be found in the Administration Manual, Chapter "Printer Operation", Section "Command Line Tools for the CUPS Printing System", Subsection "Managing Local Queues".
For clarification purposes, we have chosen an example of a correct situation that becomes more and more confusing. To keep this example as concise and clear as possible, only command line instructions are used. However, it would make no difference if graphical tools like Kprinter and XPP or the CUPS web front-end were used instead.
Initial state:
Because both queues will be used for the same printer, the same PPD file will be used as basis for the two queues, but with different default values preset for each queue. YaST2, for example, uses this approach when generating different configurations (see the SDB article "Printer Configuration with SuSE Linux 8.1" (http://sdb.suse.de/en/sdb/html/jsmeix_print-einrichten-81.html)).
The PPD files corresponding to the queues /etc/cups/ppd/mono.ppd
and
/etc/cups/ppd/color.ppd
contain the following possible settings and default values:
*DefaultColors: Gray *Colors Gray ... *Colors Color ... ... *DefaultInkCartridge: Black *InkCartridge Black ... *InkCartridge Color ... ... *DefaultResolution: 600dpi *Resolution 150dpi ... *Resolution 300dpi ... *Resolution 600dpi ...and
*DefaultColors: Color *Colors Gray ... *Colors Color ... ... *DefaultInkCartridge: Color *InkCartridge Black ... *InkCartridge Color ... ... *DefaultResolution: 300dpi *Resolution 150dpi ... *Resolution 300dpi ... *Resolution 600dpi ...It is advisable to have several queues with their respective settings for the same printer due to the following reasons:
Colors=Gray
and InkCartridge=Black
Colors=Color
and InkCartridge=Color
150dpi
, 300dpi
, and 600dpi
work for "mono".
150dpi
and 300dpi
work for "color".
Now the options will be changed in the following order:
lpadmin -p mono -o Resolution=150dpi
/etc/cups/ppd/mono.ppd
*DefaultColors: Gray *Colors Gray ... *Colors Color ... ... *DefaultInkCartridge: Black *InkCartridge Black *InkCartridge Color ... *DefaultResolution: 150dpi *Resolution 150dpi ... *Resolution 300dpi ... *Resolution 600dpi ...Thus, the queue "mono" prints in grayscale with a 150 dpi resolution for all users on all machines.
lpoptions -p mono -o Resolution=300dpi
/etc/cups/lpoptions
:
Dest mono Resolution=300dpiThus, "mono" prints in grayscale with a 300 dpi resolution for all the users on "sun" and in grayscale with a 150 dpi resolution for all users on "earth" and "moon".
lpoptions -p mono -o Resolution=600dpi
/etc/cups/lpoptions
Dest mono Resolution=600dpiThus, "mono" prints in grayscale with a 600 dpi resolution for all the users on "earth", in grayscale with a 300 dpi resolution for all the users on "sun", and in grayscale with a 150 dpi resolution for all the users on "moon".
lpoptions -p mono -o Resolution=300dpi
~/.lpoptions
:
Dest mono Resolution=300dpiThus, "mono" prints in grayscale with a 300 dpi resolution for the user "tux" on "earth" and in grayscale with a 600 dpi resolution for the rest of users on "earth". The settings on "sun" and "moon" remain unchanged.
lpoptions -p mono -o Colors=Color
~/.lpoptions
in his home directory:
Dest mono Colors=ColorGeeko's settings for the queue "mono" on "earth" make no sense, because two contradictory values are used:
Colors=Color
and InkCartridge=Black
.
lpoptions -p color -o Resolution=600dpi
~/.lpoptions
:
Dest color Resolution=600dpi Dest mono Colors=ColorThe settings of the queue "color" for "geeko" on "earth" are wrong, because the only deployed value is
Resolution=600dpi
, which does not work for this
printer (see above). This results in the queue "color" no longer working for "geeko"
on "earth".
lpoptions -p color -o Resolution=1200dpi -o Foo=Bar
~/.lpoptions
:
Dest color Resolution=1200dpi Foo=Bar Dest mono Colors=ColorIt is possible to set values like
Resolution=1200dpi
and options like
Foo=Bar
, even though they are not considered in the PPD file. When printing,
however, the default value from the PPD file (Resolution=300dpi
) will be used and
the option (Foo=Bar
) will be ignored. Thus, the queue "color" works again for "geeko"
on "earth", but the set values are totally unsuitable.
lpadmin -x mono
lpoptions
mentioned above are not deleted, but
remain unchanged.
*DefaultColours: Gray *Colours Gray ... *Colours Color ... ... *DefaultResolution: 300x300dpi *Resolution 300x300dpi ... *Resolution 600x600dpi ...None of the previous entries in the files
lpoptions
are valid
for the new queue "mono", since either the option names no longer match
(Colours
instead of Colors
) so the option is
ignored or the option values no longer match (300x300dpi
and
600x600dpi
instead of 150dpi
, 300dpi
,
and 600dpi
) so the default value from the PPD file is used.
~/.lpoptions
), those
settings will be used for the print job.
/etc/cups/lpoptions
is already available on the computer, only the options
not previously defined by the user will be used for the print job.
lpoptions -p "queue" -l
*
.
According to this, the user "geeko" on "earth" might have used the following command
in item 7
lpoptions -p color -l
to verify which settings would be used for his print job via the queue "color". He
would have seen that these do not correspond to the settings in his file
~/.lpoptions
, because the output would be
Colors: Gray *Color InkCartridge: Black *Color Resolution: 150dpi *300dpi 600dpi
/etc/cups/lpoptions
files.
lpoptions
as "root"
on each machine. Instead, execute the command lpadmin
on the CUPS server.
/etc/cups/ppd/mono.ppd
and /etc/cups/ppd/color.ppd
manually on the CUPS server as follows (see also the article
"ASCII Editors" (http://sdb.suse.de/en/sdb/html/thallma_ascii_editor.html)):
*DefaultColors: Gray *Colors Gray ... ... *DefaultInkCartridge: Black *InkCartridge Black ... ..."root" *DefaultResolution: 600dpi *Resolution 150dpi ... *Resolution 300dpi ... *Resolution 600dpi ...and
*DefaultColors: Color *Colors Color ... ... *DefaultInkCartridge: Color *InkCartridge Color ... ... *DefaultResolution: 300dpi *Resolution 150dpi ... *Resolution 300dpi ...The "constraints" should avoid any incompatible value combinations in the PPD file, but this is not totally reliable yet. After manually changing PPD files, the CUPS daemon must be forced to reread the files using the command
rccups reload
.
~/.lpoptions
files,
especially if a queue is deleted completely or if a different
PPD file will be used for an existing queue.
lpoptions -x "queue"
lpoptions -x mono
~/.lpoptions
files then
reconfigure their personal settings for the relevant queue.
lpoptions -x
does not work for deleted queues. Invalid entries can be either
ignored or manually deleted from the ~/.lpoptions
file (see the SDB article
"ASCII Editors" (http://sdb.suse.de/en/sdb/html/thallma_ascii_editor.html)).
rm ~/.lpoptions
SDB-jsmeix_print-cups-options
)