CUPS web admin page hangs

  • Done
  • quality assurance status badge
Details
3 participants
  • Brice Waegeneire
  • hot12shots
  • Marius Bakke
Owner
unassigned
Submitted by
hot12shots
Severity
normal
Merged with
H
H
hot12shots wrote on 26 Feb 2020 11:02
(address . bug-guix@gnu.org)
CAAkdc5Dy-=TUZY7oYnZ0VA7AMoHEfYB1OC-2SVEzbP075EstUg@mail.gmail.com
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/adminin 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
M
M
Marius Bakke wrote on 27 Jun 2020 11:32
(address . control@debbugs.gnu.org)
871rm0dfb6.fsf@gnu.org
merge 39801 42068
thanks
B
B
Brice Waegeneire wrote on 19 Jun 2021 10:19
(address . control@debbugs.gnu.org)
E1luWCj-0004Gg-F1@debbugs.gnu.org
merge 49106 39801
quit
?