Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1144780

Summary: cups starts before networking, therefore is not available
Product: Red Hat Enterprise Linux 7 Reporter: spamers
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jpopelka, jscotka, psklenar, shane.ley, spamers
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cups-1.6.3-17.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1153660 (view as bug list) Environment:
Last Closed: 2015-03-05 09:09:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1153660    
Bug Blocks:    

Description spamers 2014-09-20 17:20:02 UTC
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:

Comment 2 Jiri Popelka 2014-09-24 08:51:40 UTC
(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.

Comment 3 spamers 2014-09-24 12:58:15 UTC
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.

Comment 4 Jiri Popelka 2014-09-25 09:30:19 UTC
(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

Comment 5 spamers 2014-09-25 10:24:48 UTC
`After` sounds good. I'm glad my feedback and bug report was useful.

Comment 10 Shane 2015-02-26 21:28:35 UTC
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.

Comment 12 errata-xmlrpc 2015-03-05 09:09:18 UTC
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