Red Hat Bugzilla – Bug 1144780
cups starts before networking, therefore is not available
Last modified: 2015-03-05 04:09:18 EST
Description of problem: Systemd starts cups before networking is ready, therefore cups doesn't want to start. More info in Steps to reproduce. CUPS will try to start, but will throw error (from /var/log/cups/error_log: Unable to bind socket for address 192.168.1.X:631 - Cannot assign requested address.) Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: !. Install cups from official repo and configure to listen for network connections. 2. enable cups in systemd (systemctl enable cups) 3. Configure networking in NetworkManager, e.g. like static ip address. 4. restart pc Actual results: 5. CUPS is not working! Expected results: CUPS available through network. Additional info:
(In reply to spamers from comment #0) > Steps to Reproduce: > ... configure to listen for network connections. Did you change the default configuration (cupsd.conf) somehow ? note: Fedora's bug #756550 seems similar.
Yes, I added: Listen 192.168.1.3:631 instead of Listen localhost:631 As I wrote earlier, CUPS is unable to bind socket for address, because network is not ready. What is more, dding Wants=network.target to /etc/systemd/system/printer.target.wants/cups.service solves problem. It's my suggestion.
(In reply to spamers from comment #3) > Yes, I added: > Listen 192.168.1.3:631 > instead of > Listen localhost:631 > > As I wrote earlier, CUPS is unable to bind socket for address, because > network is not ready. Thanks. I haven't been able to reproduce it because in my case the network interfaces are always (regardless if I use NetworkManager or only legacy 'network') configured prior to systemd starting CUPS. > What is more, adding > Wants=network.target > to /etc/systemd/system/printer.target.wants/cups.service > solves problem. It's my suggestion. I think After=network.target not Wants=network.target is what we want here. http://www.freedesktop.org/software/systemd/man/systemd.unit.html
`After` sounds good. I'm glad my feedback and bug report was useful.
Fedora fix is: http://pkgs.fedoraproject.org/cgit/cups.git/commit/?h=f21&id=a52574af07ff039fa4d3336c6042325e00a19975
I've also encountered this bug and, as above, fixed it by adding After=network.target to the cups.service Systemd unit file. I came here to report this bug, only to find that it's been known about for nearly six months. I'm disappointed that no update has been released, given the fix is a simple one-line change to a configuration file. I wasted hours diagnosing this, thinking I must have been doing something wrong.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0386.html