# CUPS seems a bit flakey *** MORE OR LESS FIXED ITSELF ***

## The Mountain Man

I've noticed that CUPS takes an inordinately long time to start up during boot, around 30-seconds.  Same thing if I execute "/etc/init.d/cupsd restart".  It eventually starts up, but it takes awhile.  I've noticed a similar delay when I try to print something in KDE, though it does print without problems eventually.

Also, I can't access http://localhost:631/ through Firefox (it times out after a couple of minutes), but it seems to work fine through Konqueror.

I'm using a Lexmark Z611 with the 1.0-1 drivers.

Anybody have any ideas?

----------

## blueflame

Sometihng to try ... Edit your cupds.conf file and set the logging level to 'debug'. Then restart cups and check the log file and look for tasks with a 30 second gap between them.

Often delays like this are caused by network problems, specifically hostname lookups and reverse-hostname lookups. These can occur because of misconfigured network settings on your box, or a misconfigured CUPS.  :Smile: 

Posting your cupsd.conf file here will help ...

----------

## The Mountain Man

Alright, I turned debugging on, and here's the output from /var/log/cups/error_log:

```
I [02/Jun/2008:08:03:35 -0400] Scheduler shutting down normally.

I [02/Jun/2008:08:03:35 -0400] Saving job cache file "/var/cache/cups/job.cache"...

I [02/Jun/2008:08:04:15 -0400] Listening to ::1:631 (IPv6)

I [02/Jun/2008:08:04:15 -0400] Listening to 127.0.0.1:631 (IPv4)

I [02/Jun/2008:08:04:15 -0400] Listening to /var/run/cups/cups.sock (Domain)

I [02/Jun/2008:08:04:15 -0400] Loaded configuration file "/etc/cups/cupsd.conf"

I [02/Jun/2008:08:04:15 -0400] Using default TempDir of /var/spool/cups/tmp...

I [02/Jun/2008:08:04:15 -0400] Configured for up to 100 clients.

I [02/Jun/2008:08:04:15 -0400] Allowing up to 100 client connections per host.

I [02/Jun/2008:08:04:15 -0400] Using policy "default" as the default!

I [02/Jun/2008:08:04:15 -0400] Full reload is required.

I [02/Jun/2008:08:04:15 -0400] Loaded MIME database from '/etc/cups': 35 types, 38 filters...

D [02/Jun/2008:08:04:15 -0400] Loading printer Lexmark...

I [02/Jun/2008:08:04:15 -0400] Loading job cache file "/var/cache/cups/job.cache"...

D [02/Jun/2008:08:04:15 -0400] [Job 24] Loading from cache...

D [02/Jun/2008:08:04:15 -0400] [Job 40] Loading from cache...

D [02/Jun/2008:08:04:15 -0400] [Job 41] Loading from cache...

I [02/Jun/2008:08:04:15 -0400] Full reload complete.

I [02/Jun/2008:08:04:15 -0400] Cleaning out old temporary files in "/var/spool/cups/tmp"...

E [02/Jun/2008:08:04:16 -0400] Unable to open listen socket for address ::1:631 - Address family not supported by protocol.

I [02/Jun/2008:08:04:16 -0400] Listening to 127.0.0.1:631 on fd 3...

I [02/Jun/2008:08:04:16 -0400] Listening to /var/run/cups/cups.sock on fd 4...

I [02/Jun/2008:08:04:16 -0400] Resuming new connection processing...

D [02/Jun/2008:08:04:17 -0400] Report: clients=0

D [02/Jun/2008:08:04:17 -0400] Report: jobs=3

D [02/Jun/2008:08:04:17 -0400] Report: jobs-active=0

D [02/Jun/2008:08:04:17 -0400] Report: printers=1

D [02/Jun/2008:08:04:17 -0400] Report: printers-implicit=0

D [02/Jun/2008:08:04:17 -0400] Report: stringpool-string-count=311

D [02/Jun/2008:08:04:17 -0400] Report: stringpool-alloc-bytes=7000

D [02/Jun/2008:08:04:17 -0400] Report: stringpool-total-bytes=6216
```

Also my cupsd.conf:

```
#

# "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $"

#

#   Sample configuration file for the Common UNIX Printing System (CUPS)

#   scheduler.  See "man cupsd.conf" for a complete description of this

#   file.

#

# Log general information in error_log - change "info" to "debug" for

# troubleshooting...

LogLevel debug

# Administrator user group...

SystemGroup lpadmin

# Only listen for connections from the local machine.

Listen localhost:631

Listen /var/run/cups/cups.sock

# Show shared printers on the local network.

Browsing On

BrowseOrder allow,deny

BrowseAllow all

# Default authentication type, when authentication is required...

DefaultAuthType Basic

# Restrict access to the server...

<Location />

  Order allow,deny

</Location>

# Restrict access to the admin pages...

<Location /admin>

  Encryption Required

  Order allow,deny

</Location>

# Restrict access to configuration files...

<Location /admin/conf>

  AuthType Default

  Require user @SYSTEM

  Order allow,deny

</Location>

# Set the default printer/job policies...

<Policy default>

  # Job-related operations must be done by the owner or an administrator...

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew$

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  # All administration operations require an administrator to authenticate...

  <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>

  # All printer operations require a printer operator to authenticate...

  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-H$

    AuthType Default

    Require user @SYSTEM

    Order deny,allow

  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...

  <Limit Cancel-Job CUPS-Authenticate-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit All>

    Order deny,allow

  </Limit>

</Policy>

#

# End of "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $".

#
```

----------

## The Mountain Man

So, anybody have any ideas?

----------

## The Mountain Man

Am I to take it this is a unique problem that nobody has any idea how to fix?

----------

## mikegpitt

I found this link:

http://lists.opensuse.org/opensuse-bugs/2006-12/msg06902.html

Your problem may be related to ipv6.  I'm not entirely sure how you would go about fixing this.  Personally I disable ipv6 by adding -ipv6 to my USE flags.  Maybe you should upgrade cups and perhaps recompile it's dependencies.

----------

## The Mountain Man

I disabled ipv6 and recompiled, but the problem remains.  This really sucks because it makes it a pain to print from my Linux box; sometimes programs will lock-up instead of sending anything to the printer.  I have no idea what the problem could be because it started suddenly some months back, and I've had a hell of a time finding a solution.

Edit: Gah!  Now it appears that the KDE print interface locks up whenever I attempt to access it!  Curiously, a test page printed from the CUPS browser interface without a hitch, so might this be a KDE problem and not a CUPS one at all?

----------

## mikegpitt

If you disabled ipv6 for cups, I would recommend disabling it for all packages...  (add -ipv6 to your USE flags in /etc/make.conf and run an emerge -DuN world).  I'm not sure if this will help however.

I'm wondering if it could have something to do with your kernel, since the problem seems related to networking.  How did you configure your kernel?  I usually recommend a genkernel configuration, just to make sure you haven't left anything out.

Also, are you running a firewall that could be messing with cups local connections?

----------

## jcat

If you're not using IPv6, you could also take it out of the kernel if you happen to be re-compiling it any time soon  :Smile: 

Cheers,

jcat

----------

## The Mountain Man

 *mikegpitt wrote:*   

> If you disabled ipv6 for cups, I would recommend disabling it for all packages...  (add -ipv6 to your USE flags in /etc/make.conf and run an emerge -DuN world).  I'm not sure if this will help however.

 

Yes, I did that.

 *mikegpitt wrote:*   

> I'm wondering if it could have something to do with your kernel, since the problem seems related to networking.  How did you configure your kernel?  I usually recommend a genkernel configuration, just to make sure you haven't left anything out.

 

I configure it "by hand", same way I've done it for the past 6-years running Gentoo.  I usually just copy my old config and run "make oldconfig" anyway, though if there's lots of new stuff that I don't recognize then I'll use menu config and check things out for myself.  But based on the above comment, I need to remove ipv6 from my kernel anyway, so I'll need to recompile it soon.

 *mikegpitt wrote:*   

> Also, are you running a firewall that could be messing with cups local connections?

 

No, I'm not.

Edit: Just checked my .config and it looks ipv6 is not in my kernel:

```
# CONFIG_IPV6 is not set
```

----------

## The Mountain Man

An update to this ancient problem:

It seems that this whole time it was KDEPrint causing me this headache.  I recently upgraded to KDE 4.x which apparently doesn't include KDEPrint by default, and the problem magically went away: CUPS starts instantly during boot, my printer starts instantly when I print from any of my applications.  I haven't checked the web interface, so I'm not sure if the Firefox oddity has been squashed, but at least I can print like a normal person again.

----------

