[cups-devel] [UNKN] STR #4618: Using host name in /etc/cups/cupsd.conf Listen directive could make cupsd listen on the wrong IP
noreply at cups.org
Fri Apr 10 14:56:55 PDT 2015
-----BEGIN PGP SIGNED MESSAGE-----
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
This is most likely caused by the way systemd org.cups.cupsd.service is
System: Arch Linux
Relevant packages' versions: systemd 218-2, cups 2.0.2-3
When cupsd is instructed in /etc/cups/cupsd.conf to listen only on some
selected interfaces (IPs), instead of listening on all available
(“Port” directive), it may happen, that the daemon ends up listening on
the wrong IP, if “Listen” directive was supplied with host name instead
of an explicit IP address and cupsd wasn't able to query DNS to supply
proper IP for the host name. It's most likely to happen, when the host
running cupsd relies on DHCP to configure its interfaces and cupsd is
started before relevant interfaces are brought up.
I'm booting my system. In /etc/cups/cupsd.conf (attached to this report)
I've got 3 “Listen” directives: one set to localhost, one to socket and
one to my host name (“gizmo:631”). When the host is up and running, I
can see (ss -tuln | grep -i 631) that cupsd listens on localhost
(127.0.0.1) and on 127.0.0.2, instead of the IP assigned to my host via
DHCP. Restarting cupsd service (I'm using systemd), of course, solves the
problem, but it's at least inconvenient to do so after each reboot.
Obviously setting IP to some explicit value would be, most of the time, a
feasible option, but that kind of hard-coding things may be dangerous too.
Maybe dependency on network would be in order in cupsd service?
Steps to reproduce:
* Make sure cupsd listens only on interfaces defined by “Listen”
directives in /etc/cups/cupsd.conf and at least one of these interfaces is
defined as a host name.
* Make sure that previously given host name's IP can be retrieved by DNS
* Make sure org.cups.cupsd.service is enabled and relevant interface is
configured by DHCP.
* Boot the system.
* Check the IPs of the interfaces the cups daemon listens on.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: GPGTools - https://gpgtools.org
-----END PGP SIGNATURE-----
More information about the cups