https://issues.apache.org/bugzilla/show_bug.cgi?id=55340
Bug ID: 55340
Summary: Listen for valid, unconfigured IP address passes
configtest, but Apache shuts down on reload
Product: Apache httpd-2
Version: 2.2.22
Hardware: PC
OS: Linux
Status: NEW
Severity: major
Priority: P2
Component: Core
Assignee: [email protected]
Reporter: [email protected]
This is somewhat related to bug 34148, but addresses a different point:
Apache's elected handling of Listen statements violates the principle of least
surprise, as well as making it very hard to detect when something might not
work.
Here are three examples, the third is what I think is wrong.
The examples have been tested with Apache 2.2.6 (Debian squeeze) and 2.2.22
(Debian wheezy).
----------------------------------------------------------------------
1) Bogus IP address (e.g. 999999.99999.9999)
----------------------------------------------------------------------
root@server:~# apachectl configtest
Syntax error on line 17 of /etc/apache2/ports.conf:
Port must be specified
Action 'configtest' failed.
The Apache error log may have more information.
root@server:~# echo $?
1
----------------------------------------------------------------------
2) Valid, unconfigured IP address, port unspecified (e.g. 10.0.0.2):
----------------------------------------------------------------------
root@server:~# apachectl configtest
Syntax error on line 17 of /etc/apache2/ports.conf:
Port must be specified
Action 'configtest' failed.
The Apache error log may have more information.
root@server:~# echo $?
1
----------------------------------------------------------------------
3) Valid, unconfigured IP address, port specified (e.g. 10.0.0.2:80):
----------------------------------------------------------------------
root@server:~# apachectl configtest
Syntax OK
root@server:~# echo $?
0
root@server:~# service apache2 reload
Reloading web server config: apache2.
root@server:~# lsof -Pni:80
root@server:~# pgrep apache2
root@server:~# tail -4 /var/log/apache2/error_log
[Thu Aug 01 15:29:48 2013] [notice] SIGUSR1 received. Doing graceful restart
(99)Cannot assign requested address: make_sock: could not bind to address
10.0.0.2:80
no listening sockets available, shutting down
Unable to open logs
----------------------------------------------------------------------
There are two sane ways of handling this, and I think both should be
implemented, as they complement eachother:
a) Do NOT pass config testing when a listening socket is unavailable. Consider
having different return codes depending on how many listening sockets fail:
I) no
II) some
III) all
b) Do not say "no listening sockets available" and do not shut down, when there
are several listening sockets available, which are both valid and configured,
and ready to use. Merely ignore those that cannot be opened, and if _absolutely
no_ sockets can be opened, shut down.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]