Bug 246027 - Printer operation policy not set on service start / restart / reload
Printer operation policy not set on service start / restart / reload
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
i386 Linux
low Severity low
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: 246029 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2007-06-27 18:34 EDT by Opher Shachar
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 1.2.12-2.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-08-03 12:14:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
CUPS Bugs and Features 2319 None None None Never

  None (edit)
Description Opher Shachar 2007-06-27 18:34:43 EDT
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):

How reproducible:

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'
Actual results:
Unlike the report in CUPS STR #2319 a reload does *not* preserve or loads 
printer operation policies.

Expected results:

Additional info:
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
Comment 1 Opher Shachar 2007-06-27 18:40:54 EDT
*** Bug 246029 has been marked as a duplicate of this bug. ***
Comment 2 Tim Waugh 2007-06-28 05:36:47 EDT
Please try the current update:

  yum update 'cups*'

Do you still see that behaviour?
Comment 3 Opher Shachar 2007-06-28 08:44:14 EDT
Hi Tim,
Did that:

    # yum list "cups*"
    Loading "installonlyn" plugin
    Setting up repositories
    Reading repository metadata in from local files
    Installed Packages
    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
    Available Packages
    cups-devel.i386                          1:1.2.10-7.fc6         updates

I still see the same behaviour.

Opher Shachar.
Comment 4 Tim Waugh 2007-06-28 08:49:33 EDT
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?
Comment 5 Opher Shachar 2007-06-28 10:04:19 EDT
Hi Tim,
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 
restorecon command)
-rw-------  root lp root:object_r:cupsd_rw_etc_t     /etc/cups/printers.conf

Still, the problem persists.

Opher Shachar.
Comment 6 Tim Waugh 2007-06-28 10:49:40 EDT
After running:

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
Comment 7 Opher Shachar 2007-06-28 16:38:39 EDT
Hi Tim,
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 
is 'foo'.

Opher Shachar.
Comment 8 Opher Shachar 2007-08-03 12:07:05 EDT
Hi Tim,
I've updated to cups 1.2.12 and as far as I can see it solved this issue.

Comment 9 Tim Waugh 2007-08-03 12:14:59 EDT

Note You need to log in before you can comment on or make changes to this bug.