Bug 1506798 (httpd_network-online)

Summary: (network-online.target) Use network-online.target instead of network.target
Product: [Fedora] Fedora Reporter: Philip Prindeville <philipp>
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 27CC: jkaluza, jorton, luhliari, pahan, philipp, rebus
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 13:00: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:    
Bug Blocks: 1119787    

Description Philip Prindeville 2017-10-26 19:21:58 UTC
Description of problem:

If your network is slow coming up (say you're using DHCP and the server is unavailable or rebooting after a power outage, etc) then this service might come up before the network is sufficiently configured.

Recommend adding

[Unit]
Wants=network-online.target
After=network-online.target

to .service file.

Version-Release number of selected component (if applicable):

httpd-2.4.28-1.fc26.x86_64

How reproducible:

Bring up host while DHCP server is down.

Steps to Reproduce:
1. Provision host to use DHCP
2. Shutdown DHCP server
3. Reboot host under test

Actual results:

Service requires host's IP address and hostname to properly operate

Expected results:

Service should not be started until network is adequately configured.

Additional info:

Comment 1 Michal Ambroz 2017-11-06 20:39:11 UTC
Affects rawhide / fc27 as well

Comment 2 Joe Orton 2017-11-28 13:00:18 UTC
In the default configuration, the service does not depend on specific IP address availability, thus the default httpd.service does not need to require network-online.target.  As documented in httpd.service(8), non-default configurations which enable httpd at boot time will need to be configured appropriately.