Bug 1432249 - must fail startup with conflicting Listen directives
Summary: must fail startup with conflicting Listen directives
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Software Collections
Classification: Red Hat
Component: httpd
Version: httpd24
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: 2.4
Assignee: Luboš Uhliarik
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-14 21:59 UTC by Hung
Modified: 2017-04-26 10:25 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2017-04-26 10:25:06 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:1161 normal SHIPPED_LIVE Moderate: httpd24-httpd security, bug fix, and enhancement update 2017-04-26 14:19:21 UTC

Description Hung 2017-03-14 21:59:50 UTC
Description of problem:
- httpd file descriptors for listening ports when reloading configuration twice is increasing 
- when httpd service reloading the same conf file with the listen directive, the httpd service should error out 

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

# rpm -qa |grep httpd 
httpd24-apr-1.5.1-1.el6.x86_64
httpd24-httpd-2.4.18-11.el6.x86_64
httpd24-runtime-1.1-14.el6.x86_64
httpd24-apr-util-1.5.4-1.el6.x86_64
httpd24-libnghttp2-1.7.1-1.el6.x86_64
httpd24-httpd-tools-2.4.18-11.el6.x86_64


How reproducible:

1) Install httpd24-httpd package 
2) Create a ports.conf 

# cat  /opt/rh/httpd24/root/etc/httpd/conf.d/ports.conf 
Listen 127.0.0.1:82
Listen [::1]:82

3) Modify the "/opt/rh/httpd24/root/etc/httpd/conf/httpd.conf" to have the following Include directive:

#tail -n 3  /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf

Include "/opt/rh/httpd24/root/etc/httpd/conf.d/ports.conf"

4) Start the httpd24-httpd service  <-------In RHEL httpd prevent the httpd from starting  

5) Run lsof command > reload the httpd24-httpd service > lsof command again 

# lsof |grep httpd| grep LISTEN |wc -l 
42

# service httpd24-httpd reload

# lsof |grep httpd| grep LISTEN |wc -l 
54

Additional info:

When reproducing this in RHEL 6 httpd start/reload up will fail see the following:

# service httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address 127.0.0.1:82
no listening sockets available, shutting down
Unable to open logs

Comment 1 Joe Orton 2017-03-15 09:30:54 UTC
Thanks for the report, it looks like this is a regression in upstream httpd 2.4.17 and later.  I've identified the fix.

http://svn.apache.org/viewvc?view=revision&revision=1777923

Comment 3 Joe Orton 2017-03-16 11:32:16 UTC
This issue was a regression with the addition of "listener buckets" in 2.4.17, which resulted in SO_REUSEPORT being enabled for all listening fds.  SO_REUSEPORT should only have been enabled if the ListenCoresBucketsRatio directive was used.  The fix is proposed for 2.4.26 and is a trivial backport.

Comment 13 errata-xmlrpc 2017-04-26 10:25:06 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://access.redhat.com/errata/RHSA-2017:1161


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