[Bug 516680] New: Apache2 Graceful restart fails:
http://bugzilla.novell.com/show_bug.cgi?id=516680 Summary: Apache2 Graceful restart fails: Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: PC OS/Version: openSUSE 11.1 Status: NEW Severity: Normal Priority: P5 - None Component: Apache AssignedTo: bnc-team-apache@forge.provo.novell.com ReportedBy: revealed@freakmail.de QAContact: qa@suse.de Found By: --- User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.11) Gecko/2009060200 SUSE/3.0.11-5.2 Firefox/3.0.11 Hello there! I am running OpenSuSE 32 bit. ## I am running Apache2. Only for testing purposes with my little home CMS via DynDNS. ## Sometimes my Machine runs a reguest to a Graceful Restart but states it does restart according to /var/log/apache2/error-log output like this (every day!): [Thu Jun 25 20:30:16 2009] [notice] Graceful restart requested, doing restart [Thu Jun 25 20:30:16 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Thu Jun 25 20:30:16 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Thu Jun 25 20:30:16 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Thu Jun 25 20:30:16 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Thu Jun 25 20:30:16 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Thu Jun 25 20:30:20 2009] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads. [Thu Jun 25 20:30:20 2009] [notice] mod_python: using mutex_directory /tmp [Thu Jun 25 20:30:20 2009] [notice] Apache/2.2.11 (Linux/SUSE) mod_ssl/2.2.11 OpenSSL/0.9.8h mod_python/3.3.1 Python/2.6 conf igured -- resuming normal operations ### So i checked manually if a graceful restart is possible: Apache2 fails doing it. Here the logfile output: [Fri Jun 26 00:30:24 2009] [notice] caught SIGTERM, shutting down [Fri Jun 26 00:32:06 2009] [notice] ModSecurity for Apache/2.5.9 (http://www.modsecurity.org/) configured. [Fri Jun 26 00:32:10 2009] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads. [Fri Jun 26 00:32:10 2009] [notice] mod_python: using mutex_directory /tmp [Fri Jun 26 00:32:11 2009] [notice] Apache/2.2.11 (Linux/SUSE) mod_ssl/2.2.11 OpenSSL/0.9.8h mod_python/3.3.1 Python/2.6 conf igured -- resuming normal operations [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:09:22 2009] [notice] caught SIGWINCH, shutting down gracefully [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:09:22 2009] [error] (9)Bad file descriptor: apr_socket_accept: (client socket) [Fri Jun 26 02:10:33 2009] [notice] ModSecurity for Apache/2.5.9 (http://www.modsecurity.org/) configured. [Fri Jun 26 02:10:33 2009] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads. [Fri Jun 26 02:10:33 2009] [notice] mod_python: using mutex_directory /tmp [Fri Jun 26 02:10:34 2009] [notice] Apache/2.2.11 (Linux/SUSE) mod_ssl/2.2.11 OpenSSL/0.9.8h mod_python/3.3.1 Python/2.6 conf igured -- resuming normal operations Here the console output: wild-thing:/home/disk # rcapache2 restart-graceful Syntax OK Shutting down httpd2 gracefully (SIGWINCH) (waiting for parent to close listen ports and remove pidfile) done Starting httpd2 (prefork) (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs startproc: exit status of parent of /usr/sbin/httpd2-prefork: 1 failed ### So i was wondering what could be the reason for. And this is actually my question. Is this a bug or a configuration error? Reproducible: Always Steps to Reproduce: 1. Machine runs daily scripts 2. Check apache2 log. 3. Restart apache2 graceful Actual Results: Apache2 does a normal restart in context with graceful but states error messages. And runs. If graceful restart is done manually it fails. Expected Results: Apache2 should be able to manage the graceful restart with no fault. Errormessages should be fixed. I got (require) the following repositorys for apache2 things: # /repositories/Apache/openSUSE_11.1/ /repositories/Apache:/Modules/openSUSE_11.1/ /repositories/server:/php/openSUSE_11.1/ /repositories/server:/php:/applications/openSUSE_11.1/ # - DynDNS is configured as Vhost. - I am running a local caching only bind server. - Suhosin Patch is installed and enabled. - Am using mod security. Here is a listing of: rpm -qa | grep apache apache2-mod_python-3.3.1-147.34 apache2-mod_perl-2.0.4-40.12 apache2-mod_php5-5.2.9-30.4 apache2-prefork-2.2.11-10.1 apache2-utils-2.2.11-10.1 apache2-mod_fcgid-2.2-31.81 apache2-mod_security2-2.5.9-5.1 apache2-mod_limitipconn-0.22-7.1 apache2-mod_memcache-0.1.0-10.1 apache2-example-pages-2.2.11-10.1 apache2-mod_stats-1.1-37.1 apache2-2.2.11-10.1 apache2-doc-2.2.11-10.1 apache2-mod_asn-1.0-73.1 Will attach my sysconfig for apache2. Plese let me know which informations you would need additionally, in case that i can help finding the reason! Many Thanks for your Help! Greetings, -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=516680
User revealed@freakmail.de added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c1
--- Comment #1 from revealed revealed
http://bugzilla.novell.com/show_bug.cgi?id=516680
User revealed@freakmail.de added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c2
--- Comment #2 from revealed revealed
APACHE_CONF_INCLUDE_FILES=""
APACHE_CONF_INCLUDE_DIRS=""
APACHE_MODULES="actions alias vhost_alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5 rewrite unique_id security2 python status memcache cache limitipconn fcgid"
APACHE_SERVER_FLAGS="SSL"
APACHE_HTTPD_CONF=""
APACHE_MPM="prefork"
APACHE_SERVERADMIN="root"
APACHE_SERVERNAME="www.SERVERNAME.org"
APACHE_START_TIMEOUT="2"
APACHE_SERVERSIGNATURE="off"
APACHE_LOGLEVEL="warn"
APACHE_ACCESS_LOG="/var/log/apache2/access_log combined"
APACHE_USE_CANONICAL_NAME="off"
#APACHE_SERVERTOKENS="OS" APACHE_SERVERTOKENS="ProductOnly"
APACHE_EXTENDED_STATUS="on"
DOC_SERVER="no"
-- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=516680
User poeml@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c3
Peter Poeml
http://bugzilla.novell.com/show_bug.cgi?id=516680
User revealed@freakmail.de added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c4
--- Comment #4 from revealed revealed
http://bugzilla.novell.com/show_bug.cgi?id=516680
User poeml@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c5
--- Comment #5 from Peter Poeml
http://bugzilla.novell.com/show_bug.cgi?id=516680
User revealed@freakmail.de added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c6
--- Comment #6 from revealed revealed
http://bugzilla.novell.com/show_bug.cgi?id=516680
User poeml@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c7
--- Comment #7 from Peter Poeml
I think the Graceful restart is done by these: Jun 25 20:30:09 wild-thing run-crons[25698]: 0logwatch: OK Jun 25 20:30:15 wild-thing run-crons[25698]: logdigest: OK Jun 25 20:30:16 wild-thing run-crons[25698]: logrotate: OK Jun 25 20:30:17 wild-thing run-crons[25698]: suse-clean_catman: OK
Exactly, logrotate is the one which causes daily reloads. It'll move away some log files (to compress them), and "rcapache2 reload". That's the graceful restart that causes Apache to keep running, but reopen its logfiles and spawn new children processes. logrotate may cause several of these reloads, because it may do them for several logfiles. Apache logs "caught SIGTERM, shutting down" for that, because that's the signal that it gets. Followed by a "configured -- resuming normal operations" message, which indicates that all is fine. But when you manually issued a rcapache2 restart-graceful, that was a different command. That's the one which sends SIGWINCH (as can be seen in the log), which causes the special "graceful shutdown", that keeps Apache running for GracefulShutdownTimeout time. Now, the "Address already in use: make_sock: could not bind to address 0.0.0.0:80" message that was logged then indicates that you *did* run into the problem that I described above; one of the cases where the graceful shutdown & restart doesn't work. What you wanted to do is "rcapache2 reload" to trigger the issue that you saw :-) You might set GracefulShutdownTimeout in the configuration and see if it makes the graceful shutdown & restart work in your setup, but you might as well just ignore it, because I assume that you just wanted to reproduce the error messages that you saw in the logs.
I will have to wait until these scripts are being run. To check if The timeout setting can fix this.
You can call /etc/cron.daily/logrotate at any time, to experiment. Or simply /usr/sbin/logrotate. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=516680
User poeml@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c8
--- Comment #8 from Peter Poeml
http://bugzilla.novell.com/show_bug.cgi?id=516680
User revealed@freakmail.de added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c9
--- Comment #9 from revealed revealed
http://bugzilla.novell.com/show_bug.cgi?id=516680
User revealed@freakmail.de added comment
http://bugzilla.novell.com/show_bug.cgi?id=516680#c10
--- Comment #10 from revealed revealed
https://bugzilla.novell.com/show_bug.cgi?id=516680
https://bugzilla.novell.com/show_bug.cgi?id=516680#c11
Roman Drahtmueller
participants (1)
-
bugzilla_noreply@novell.com