bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39801: CUPS web admin page hangs


From: hot12shots
Subject: bug#39801: CUPS web admin page hangs
Date: Wed, 26 Feb 2020 10:02:33 +0000

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

Attachment: log
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]