Bug 565674 - should /etc/cups/{printers,classes}.conf be in /var/lib/cups?
Summary: should /etc/cups/{printers,classes}.conf be in /var/lib/cups?
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-15 21:51 UTC by James Ralston
Modified: 2011-05-31 14:44 UTC (History)
3 users (show)

Fixed In Version: cups-1.5-0.2.b2.fc16
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-31 14:44:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CUPS Bugs and Features 3726 0 None None None Never

Description James Ralston 2010-02-15 21:51:39 UTC
We have a mechanism to detect and alert us when configuration files have been changed.

We noticed that cupsd rewrites the /etc/cups/printers.conf file every time it starts:

$ diff -U 3 printers.conf /etc/cups/printers.conf
--- printers.conf       2010-02-15 16:31:39.551189687 -0500
+++ /etc/cups/printers.conf     2010-02-15 16:34:59.209137649 -0500
@@ -1,5 +1,5 @@
 # Printer configuration file for CUPS v1.4.2
-# Written by cupsd on 2010-02-15 16:31
+# Written by cupsd on 2010-02-15 16:34
 # DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
 <DefaultPrinter Cups-PDF>
 Info Cups-PDF

This is bogus. Daemons shouldn't arbitrarily rewrite their own configuration files.

What seems to be happening is that cups is using printers.conf less as a configuration file, and more as a mechanism to save/restore state. If that's the case, then this file should be named /var/lib/cups/printers, not /etc/cups/printers.conf.

Versions:

1:cups-1.4.2-20.fc12.x86_64

Comment 1 Tim Waugh 2010-02-16 14:56:40 UTC
Marking as FutureFeature for consideration.  It is a large change to make in terms of user expectation.

Comment 2 James Ralston 2010-02-16 21:24:23 UTC
Perhaps. But since system-config-printer is the preferred administration mechanism, and http-based administration can also be used, I'm not sure that it matters that much.

I suspect that users who are expert enough to be editing cups configuration files by hand are users who will be able to discover that the "config" files are in /var/lib/cups.

And it is definitely wrong for a daemon to be maintaining state files in /etc, even if they are (mis)used as config files.

Comment 3 Dominic Cleal 2010-11-04 14:57:15 UTC
Could the timestamp updates be disabled, still permitting CUPS to rewrite the configuration file data if needed?  This solves the immediate problem of CUPS upsetting auditing and fighting configuration management systems.

This seems to be the solution that Debian opted for (no-conffile-timestamp.dpatch):
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549673#29

Comment 4 Tim Waugh 2010-11-04 17:49:15 UTC
Turning off the timestamp altogether seems wrong -- CUPS *will* rewrite that file when its configuration is changed via IPP, so we may as well know when that happened.

I could see about removing the need to re-write the file on start-up though, if that's still happening; i.e. avoiding unnecessary re-writes of the file.

Comment 5 Tim Waugh 2010-11-19 15:53:46 UTC
Change from comment #4 filed upstream.

Comment 6 Tim Waugh 2011-02-14 15:40:35 UTC
Fix will be in 1.4.7.


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