Bug 1825554
Summary: | Apache HTTPD service fails to start at startup due to NIC not having IP address assigned. Starts fine manually. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | David Both <dboth> |
Component: | httpd | Assignee: | Luboš Uhliarik <luhliari> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 31 | CC: | anon.amish, fadamo, jkaluza, jorton, lnykryn, luhliari, msekleta, mturk, pahan, ssahani, s, systemd-maint, zbyszek |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-04-20 13:56:14 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: |
Description
David Both
2020-04-18 21:19:48 UTC
systemd is just the manager here, and if httpd needs to be ordered after some requirements are met, this would need to be expressed in the unit file. But in this particular case, it sounds like httpd should be using IP_FREEBIND to allow it to bind to the address and not force any ordering. See "man httpd.service" - Starting the service at boot time The httpd.service and httpd.socket units are disabled by default. To start the httpd service at boot time, run: systemctl enable httpd.service. In the default configuration, the httpd daemon will accept connections on port 80 (and, if mod_ssl is installed, TLS connections on port 443) for any configured IPv4 or IPv6 address. If httpd is configured to depend on any specific IP address (for example, with a "Listen" directive) which may only become available during start-up, or if httpd depends on other services (such as a database daemon), the service must be configured to ensure correct start-up ordering. For example, to ensure httpd is only running after all configured network interfaces are configured, create a drop-in file (as described above) with the following section: [Unit] After=network-online.target Wants=network-online.target See https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ for more information on start-up ordering with systemd. Thanks for pointing me to this as a better circumvention to the problem. It does work as expected. And thanks for the link to start-up ordering. However I think it is still a bug because it is quite common - at least in my experience - to use a Listen directive. I have always used Listen directives, even on hosts with only a single IP address and it is clearly necessary on hosts with multiple NICs and IP addresses. Adding the lines above to the /usr/lib/systemd/system/httpd.service default file. Adding these entries would cause no problems for configurations not using a Listen directive and would prevent this problem for those that do. In addition I believe that something changed to cause this to occur. It was not a problem in the past. Unfortunately I did not keep good records of when this first started happening. So I do have a question I hope you will answer. Who is responsible for fixing problems with systemd unit files in a situation like this? Is it for the service developers such as those for httpd? Or is it the responsibility of the systemd team? I want to know so I can try to submit to the correct place in the future. Anyway - Thank you. (In reply to David Both from comment #3) > In addition I believe that something changed to cause this to occur. It was > not a problem in the past. Unfortunately I did not keep good records of when > this first started happening. The httpd behaviour has not changed here since whenever Fedora started using systemd. > So I do have a question I hope you will answer. Who is responsible for > fixing problems with systemd unit files in a situation like this? Is it for > the service developers such as those for httpd? Or is it the responsibility > of the systemd team? I want to know so I can try to submit to the correct > place in the future. In the first instance, the package which owns the relevant unit. In the unlikely case we determine an issue is due to systemd, we can reassign appropriately. I really think httpd should be using IP_FREEBIND. Anything else is setting up the user for failure. (I guess it could be opt-in or opt-out. But it certainly should be offered as an option.) I resurrected Lubos' patch to do that upstream. https://bz.apache.org/bugzilla/show_bug.cgi?id=61865 (In reply to Joe Orton from comment #6) > I resurrected Lubos' patch to do that upstream. > https://bz.apache.org/bugzilla/show_bug.cgi?id=61865 Thank you. (In reply to David Both from comment #3) > Thanks for pointing me to this as a better circumvention to the problem. It > does work as expected. And thanks for the link to start-up ordering. > > However I think it is still a bug because it is quite common - at least in > my experience - to use a Listen directive. I have always used Listen > directives, even on hosts with only a single IP address and it is clearly > necessary on hosts with multiple NICs and IP addresses. Adding the lines > above to the /usr/lib/systemd/system/httpd.service default file. Adding > these entries would cause no problems for configurations not using a Listen > directive and would prevent this problem for those that do. > > In addition I believe that something changed to cause this to occur. It was > not a problem in the past. Unfortunately I did not keep good records of when > this first started happening. > > So I do have a question I hope you will answer. Who is responsible for > fixing problems with systemd unit files in a situation like this? Is it for > the service developers such as those for httpd? Or is it the responsibility > of the systemd team? I want to know so I can try to submit to the correct > place in the future. > > Anyway - Thank you. I really agree: >> However I think it is still a bug because it is quite common - at least in my experience - to use a Listen directive. I have always used Listen directives, even on hosts with only a single IP address and it is clearly necessary on hosts with multiple NICs and IP addresses. Adding the lines above to the /usr/lib/systemd/system/httpd.service default file. Adding these entries would cause no problems for configurations not using a Listen directive and would prevent this problem for those that do. httpd is a "network" service, it's useless without networking, it should start after the network IMO. |