2

I'm in a world of hurt at the moment with regard to printing, but I've discovered one ultra-specific problem that seems to be the root of all my other problems.

CUPS is silently unsharing my printers. I stop CUPS, manually change /etc/cups/printers.conf to say "Shared Yes" for every printer, start CUPS, and within ~2 minutes the printers.conf file gets re-written.

I can't explain this behaviour.

I've tried using other methods (ie: instead of directly editing printers.conf) of making the printers shared, such as:

cupsctl --share-printers
lpadmin -p SPDIALTO35501 -o printer-is-shared=true

They seem to have no effect whatsoever.

Can anyone help me out? I've included as much useful detail as I can below about my environment and configuration.

lpoptions -p SPDIALTO35501 output:

auth-info-required=none copies=1 device-uri=lpd://192.168.7.5 
finishings=3 job-hold-until=no-hold job-priority=50 
job-sheets=none,none marker-change-time=1429565893 
marker-colors=#000000,none,none,none,none marker-levels=-1,-1,-1,-1,-1
marker-names='Black\ Toner,,,,Waste\ Toner' 
marker-types=toner,unknown,unknown,unknown,wasteToner number-up=1 
printer-info=SPDIALTO35501 printer-is-accepting-jobs=true 
printer-is-shared=false printer-location 
printer-make-and-model='Local Raw Printer' 
printer-state=3 printer-state-change-time=1429565893 
printer-state-reasons=none printer-type=2228230 
printer-uri-supported=ipp://localhost:631/printers/SPDIALTO35501

OS: CentOS Linux release 6.0 (Final)

CUPS VERSION: cups.x86_64 1:1.4.2-35.el6

SElinux is disabled.

My cupsd.conf file SEEMS correct to me, but I'll confess I'm no expert. Here it is:

MaxLogSize 0
LogLevel debug
SystemGroup sys root
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseRemoteProtocols CUPS
BrowseAddress @LOCAL
BrowseLocalProtocols CUPS dnssd
DefaultAuthType Basic
<Location />
  # Allow shared printing...
  Order allow,deny
  Allow all
</Location>
<Location /admin>
  Order allow,deny
  Allow ALL
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow ALL
</Location>
<Policy default>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy authenticated>
  <Limit Create-Job Print-Job Print-URI>
  AuthType Default
  Order deny,allow
</Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
AuthType Default
Require user @OWNER @SYSTEM
Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
  AuthType Default
  Require user @SYSTEM
  Order deny,allow
    </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
      </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
      AuthType Default
      Require user @OWNER @SYSTEM
      Order deny,allow
        </Limit>
  <Limit All>
        Order deny,allow
          </Limit>
</Policy>

An example entry from my printers.conf file:

<DefaultPrinter SPDIALTO35501>
Info SPDIALTO35501
DeviceURI lpd://192.168.7.5
State Idle
StateTime 1429565893
Type 6
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Attribute marker-colors \#000000,none,none,none,none
Attribute marker-levels -1,-1,-1,-1,-1
Attribute marker-names Black Toner,,,,Waste Toner
Attribute marker-types toner,unknown,unknown,unknown,wasteToner
Attribute marker-change-time 1429565893
</Printer>

EDIT:

I was asked if I checked the log files. I did, but don't really see anything meaningful to me. Here is a slightly-snipped version of /var/log/cups/error_log:

I [21/Apr/2015:11:27:48 -0600] Listening to 0.0.0.0:631 (IPv4)
I [21/Apr/2015:11:27:48 -0600] Listening to :::631 (IPv6)
I [21/Apr/2015:11:27:48 -0600] Listening to /var/run/cups/cups.sock (Domain)
I [21/Apr/2015:11:27:48 -0600] Remote access is enabled.
D [21/Apr/2015:11:27:48 -0600] Added auto ServerAlias vdb2
D [21/Apr/2015:11:27:48 -0600] Added auto ServerAlias localhost6.localdomain6
D [21/Apr/2015:11:27:48 -0600] Added auto ServerAlias localhost6
I [21/Apr/2015:11:27:48 -0600] Loaded configuration file "/etc/cups/cupsd.conf"
I [21/Apr/2015:11:27:48 -0600] Using default TempDir of /var/spool/cups/tmp...
I [21/Apr/2015:11:27:48 -0600] Configured for up to 100 clients.
I [21/Apr/2015:11:27:48 -0600] Allowing up to 100 client connections per host.
I [21/Apr/2015:11:27:48 -0600] Using policy "default" as the default!
I [21/Apr/2015:11:27:48 -0600] Full reload is required.
I [21/Apr/2015:11:27:48 -0600] Loaded MIME database from "/usr/share/cups/mime" and "/etc/cups": 35 types, 41 filters...

[snipped other printers; they all behave exactly the same]

D [21/Apr/2015:11:27:48 -0600] Loading printer SPDIALTO35501...
D [21/Apr/2015:11:27:48 -0600] cupsdMarkDirty(P-----)
D [21/Apr/2015:11:27:48 -0600] load_ppd: Loading /etc/cups/ppd/SPDIALTO35501.ppd...
D [21/Apr/2015:11:27:48 -0600] cupsdRegisterPrinter(p=0x7f2af8603410(SPDIALTO35501))
D [21/Apr/2015:11:27:48 -0600] cupsdMarkDirty(P-----)
D [21/Apr/2015:11:27:48 -0600] load_ppd: Loading /etc/cups/ppd/SPDIALTO35501.ppd...
D [21/Apr/2015:11:27:48 -0600] cupsdRegisterPrinter(p=0x7f2af8603410(SPDIALTO35501))
I [21/Apr/2015:11:27:48 -0600] Loading job cache file "/var/cache/cups/job.cache"...
D [21/Apr/2015:11:27:48 -0600] [Job 38077] Loading from cache...

[many jobs, like 500ish, are loaded from the cache]

I [21/Apr/2015:11:27:48 -0600] Full reload complete.
I [21/Apr/2015:11:27:48 -0600] Cleaning out old temporary files in "/var/spool/cups/tmp"...
I [21/Apr/2015:11:27:48 -0600] Listening to 0.0.0.0:631 on fd 7...
I [21/Apr/2015:11:27:48 -0600] Listening to :::631 on fd 8...
I [21/Apr/2015:11:27:48 -0600] Listening to /var/run/cups/cups.sock on fd 9...
I [21/Apr/2015:11:27:48 -0600] Resuming new connection processing...
D [21/Apr/2015:11:27:48 -0600] Discarding unused server-started event...
D [21/Apr/2015:11:27:49 -0600] Report: clients=0
D [21/Apr/2015:11:27:49 -0600] Report: jobs=499
D [21/Apr/2015:11:27:49 -0600] Report: jobs-active=0
D [21/Apr/2015:11:27:49 -0600] Report: printers=18
D [21/Apr/2015:11:27:49 -0600] Report: printers-implicit=0
D [21/Apr/2015:11:27:49 -0600] Report: stringpool-string-count=2343
D [21/Apr/2015:11:27:49 -0600] Report: stringpool-alloc-bytes=7832
D [21/Apr/2015:11:27:49 -0600] Report: stringpool-total-bytes=38128
I [21/Apr/2015:11:28:18 -0600] Saving printers.conf...
D [21/Apr/2015:11:28:18 -0600] cupsdSetBusyState: Not busy

So, CUPS seems to be rebuilding the printers.conf file, but I have no idea why and I further have no idea why the Shared status for each printer is being reset. When I added the printer in the first place (by pasting a new entry into printers.conf), CUPS didn't rebuild it out of existence, so it doesn't seem like its taking the printer list from somewhere else. It just really, really, really doesn't want to share.

EDIT #2: I configured CUPS to allow me to connect to its web interface and tried modifying the printer that way -- with no luck. I put a checkmark in the sharing column for the printer, clicked modify, it said it modified it successfully, but the printer is still not shared. Interestingly, the OTHER changes I made (set a location name, chose a driver type) do appear in the updated printers.conf file. For some reason it just won't allow sharing -- at all.

7
  • 1
    Did you check the log?
    – 030
    Apr 21, 2015 at 16:43
  • I did, but I'm not really sure what to look for. I'll edit my post to paste the log files.
    – Michel
    Apr 21, 2015 at 17:34
  • @185140777 There -- original post edited to show the logs. I probably should have done that in the first place, of course.
    – Michel
    Apr 21, 2015 at 17:41
  • I'm not a Linux guru, but put the file read only as a quick & dirty fix ?
    – yagmoth555
    Apr 21, 2015 at 17:45
  • 1
    What does cupsctl | grep -i share show? You might need to run cupsctl --share-printers Apr 21, 2015 at 21:38

0

You must log in to answer this question.

Browse other questions tagged .