Bug 1352139 - httpd fails to start
Summary: httpd fails to start
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-01 18:32 UTC by David A. De Graaf
Modified: 2016-07-04 11:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-04 11:25:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description David A. De Graaf 2016-07-01 18:32:01 UTC
Description of problem:
On a fresh installation of Fedora 24, httpd fails to start.
journalctl -b shows these errors:
  Jun 27 10:33:17 garfield httpd[1100]: (99)Cannot assign requested
  address: AH00072: make_sock: could not bind to address
  192.168.10.99:80
  Jun 27 10:33:17 garfield httpd[1100]: no listening sockets
  available, shutting down


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


How reproducible:
100%

Steps to Reproduce:
1.  Configure httpd to listen on a specific (local) IP.
2.  Reboot.
3.  Observe that httpd failed to start.

Actual results:
httpd startup fails.

Expected results:
httpd startup succeeds.

Additional info:

It can be started manually later, readily enough, with
  systemctl start httpd
but that's a PITA.

Sam Varshavchik, on the users.org, replied to me that privoxy exhibits the same failure.  I tried his recommended fix by adding
/etc/systemd/system/httpd.service with these changes:

# diff /usr/lib/systemd/system/httpd.service /etc/systemd/system/httpd.service
19c19,21
< After=network.target remote-fs.target nss-lookup.target
---
> Wants=network-online.target
> After=network-online.target remote-fs.target nss-lookup.target
> ## After=network.target remote-fs.target nss-lookup.target

but it had no effect.  
I surely don't understand the intricacies of systemd notation.  

I also discovered BZ 1119787, which suggests this is a long-standing problem with many systemd startups, desperately seeking a solution.

Comment 1 David A. De Graaf 2016-07-01 21:38:02 UTC
Another comment from Jose Maria Terry Jimenez suggested that it's also
necessary to:
   systemctl enable NetworkManager-wait-online

And with that service also added, httpd now starts correctly.
Sheesh!

Comment 2 David A. De Graaf 2016-07-03 19:24:44 UTC
Comment 1 was based on a single test.
Two reboots following a dnf update, and a new kernel (4.6.3-300.fc24.x86_64)
have failed to start httpd.
So, the fixes fix nothing!

I'm baffled and bewildered.

Comment 3 Joe Orton 2016-07-04 11:25:40 UTC
Sorry, bugzilla isn't a support forum.  

In the default configuration, httpd does not require any specific IP address to be associated; the shipped systemd httpd.service works for the vast majority of users.  The advice around using wait-online looks correct unless systemd behaviour has changed recently there.

We've worked on adding support for IP_FREEBIND [1] to upstream httpd, in the longer-run this may be a more appropriate way to configure the server than adjusting (or re-configuring) the systemd service.

[1] See https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/


Note You need to log in before you can comment on or make changes to this bug.