Subject: bug#39801: closed (Re: CUPS :631/admin interface freezes)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 24 Jun 2021 02:19:02 +0000

Your bug report

#42068: CUPS web admin page hangs

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
42068: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=42068
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: CUPS :631/admin interface freezes
From: Tobias Geerinckx-Rice <[email-masked]>
To: [email-masked]
Date: Thu, 24 Jun 2021 04:18:45 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

I've pushed some patches I've been using since ‘forever’ to 
core-updates.  They simply remove the entire right-hand ‘Server’ 
form, and short-circuit the logic behind it that caused the long 
delays.

An older work-around I tried was to simply link to the store 
cupsd.conf in /etc/cups.  This solves the immediate problem, and 
even allows viewing (not editing) a few settings in said form. 
It's an option for those who can't wait for core-updates to be 
merged (don't forget to delete it next year… :-).

However, doing so merely hides the fact that this code is broken 
with -c FILE by effectively circumventing the option in a very 
sneaky way.  A step back, not forward.

Kind regards,

T G-R

Subject: CUPS web admin page hangs
From: hot12shots <[email-masked]>
To: [email-masked]
Date: Wed, 26 Feb 2020 10:02:33 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

The CUPS web interface in my Guix system hangs when loading the admin
page, making it cumbersome to manage CUPS printers and settings. The
cause appears to be that the web interface CGI scripts expect a config
file in the wrong location.

HOW TO REPRODUCE:

My system is running Guix commit 290b55c55a5 with the following CUPS
configuration:

        (service cups-service-type
          (cups-configuration
            (web-interface? #t)
            (log-level 'debug)
            (extensions (list cups-filters
                              foomatic-filters
                              hplip-minimal))))

I load http://localhost:631/admin in a browser (Icecat). Expected
behavior is for the page to load immediately. Actual behavior is the
page hangs for a minute or two, displaying a blank screen. Eventually
the expected Administration page loads, but is missing some controls
and displays "Unable to open cupsd.conf file: Success."

DETAILS:

Excerpt from /var/log/cups/error_log is attached. Note especially
CUPS_SERVERROOT=/etc/cups.

Output of ‘ps -ef | grep cupsd’:

        root      6374     1  0 00:29 ?        00:00:01
/gnu/store/wxg6fa0d1hlna6gg2nrn51fkq68q7fy9-cups-2.3.1/sbin/cupsd -f
-c /gnu/store/6i13apvx94y7q61rh3hsj7fhjb6brgf4-cupsd.conf -s
/gnu/store/nxzmy9s6inia31wvhrcrzcf66rb4v4pp-cups-files.conf

Output of ‘sudo strace -p `pidof cupsd` -f -e file’ while refreshing
the Administration page contains a number of entries like this:

        [pid  8423] access("/etc/cups/cupsd.conf", R_OK) = -1 ENOENT
(No such file or directory)

The directory /etc/cups exists but contains only ssl/ and ppd/
subdirectories, no cupsd.conf.

If I create a symlink /etc/cups/conf.d ->
/gnu/store/6i13...-cupsd.conf, the Administration page now loads
without any issue.

In addition, I noticed that (per Guix manual) the server-root field of
the CUPS service’s files-configuration section defaults to /etc/cups.
If I set that field to /gnu/store/wxg6...-cups-2.3.1/etc/cups (see the
cupsd command line above) then run ‘guix system reconfigure’ and
restart cupsd, the web interface again works as expected.

Finally, note that the ServerRoot field of
/gnu/store/nxzm...-cups-files.conf is set to
/gnu/store/wxg6...-2.3.1/etc/cups (again see cupsd command line
above).

COMMENTARY:

>From examining the CUPS sources, it appears the web admin interface
expects to find cupsd.conf in CUPS_SERVERROOT solely to make the "Edit
Configuration File" feature work. This feature doesn't seem very
useful on Guix since the config file lives in the (read-only) store.
However, the file still needs to be present in order to satisfy the
admin page CGI script and keep it from hanging.

Thus, perhaps the problem could be solved by having the service make a
symlink /etc/cups/cupsd.conf pointing at its generated cupsd.conf
file.

Thanks,

Jacob