Red Hat Bugzilla – Bug 246027
Printer operation policy not set on service start / restart / reload
Last modified: 2007-11-30 17:12:08 EST
Description of problem:
When the CUPS service is started or restarted or reloaded printer operation
policies are not set (they are left 'default').
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. service cups restart / start / reload
2. lpadmin -p myprinter -o printer-op-policy=foo
3. Policy takes affect.
4. service cups restart / start / reload
5. Policy for myprinter was reset to 'default'
Unlike the report in CUPS STR #2319 a reload does *not* preserve or loads
printer operation policies.
This script, placed in /etc/init.d/cups, can workaround this.
while read tag printer; do
[[ "$tag" != "<Printer" ]] && continue
while read tag value; do
[[ "$tag" == "</Printer>" ]] && break
[[ "$tag" != "OpPolicy" ]] && continue
echo "lpadmin -p $printer -o printer-op-policy=$value"
lpadmin -p $printer -o printer-op-policy=$value
done < /etc/cups/printers.conf
*** Bug 246029 has been marked as a duplicate of this bug. ***
Please try the current update:
yum update 'cups*'
Do you still see that behaviour?
# yum list "cups*"
Loading "installonlyn" plugin
Setting up repositories
Reading repository metadata in from local files
cups.i386 1:1.2.10-7.fc6 installed
cups-libs.i386 1:1.2.10-7.fc6 installed
cups-lpd.i386 1:1.2.10-7.fc6 installed
cups-pdf.i386 2.4.6-1.fc6 installed
cups-devel.i386 1:1.2.10-7.fc6 updates
I still see the same behaviour.
Sounds like your /etc/cups/printers.conf file has the wrong SELinux context.
What does this command say?:
/sbin/restorecon -v /etc/cups/printers.conf
and does the policy "stick" afterwards?
To begin with my system has SELinux set to Permissive mode.
Non the less, I ran the command /sbin/restorecon -v /etc/cups/printers.conf -
got no output.
Also, ls -Z /etc/cups/printers.conf says this: (didn't check before the
-rw------- root lp root:object_r:cupsd_rw_etc_t /etc/cups/printers.conf
Still, the problem persists.
lpadmin -p myprinter -o printer-op-policy=foo
what does your /etc/cups/printers.conf file say the policy is for that printer?
I'm trying to work out if the change makes it to disk, or if it only remains in
The change is written immediately to the file.
Also, in my original comment in step 5 I meant that CUPS *acts as if* the
policy is 'default' - the file /etc/cups/printers.conf always says the policy
I've updated to cups 1.2.12 and as far as I can see it solved this issue.