diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/apache2.2-common.apache2.init | 33 | ||||
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | debian/patches/00list | 2 | ||||
-rwxr-xr-x | debian/patches/053_bad_file_descriptor_PR42829.dpatch | 38 |
4 files changed, 48 insertions, 35 deletions
diff --git a/debian/apache2.2-common.apache2.init b/debian/apache2.2-common.apache2.init index a555308e..0c6eb9a7 100644 --- a/debian/apache2.2-common.apache2.init +++ b/debian/apache2.2-common.apache2.init @@ -98,7 +98,7 @@ pidof_apache() { apache_stop() { if `$APACHE2CTL configtest > /dev/null 2>&1`; then # if the config is ok than we just stop normaly - $APACHE2CTL stop + $APACHE2CTL graceful-stop else # if we are here something is broken and we need to try # to exit as nice and clean as possible @@ -122,34 +122,6 @@ apache_stop() { fi } -apache_sync_stop() { - # running ? - PIDTMP=$(pidof_apache) - if $(kill -0 "${PIDTMP:-}" 2> /dev/null); then - PID=$PIDTMP - fi - - apache_stop - - # wait until really stopped - if [ -n "${PID:-}" ]; then - i=0 - while $(kill -0 "${PID:-}" 2> /dev/null); do - if [ $i = '30' ]; then - break; - else - if [ $i = '0' ]; then - echo -n " waiting " - else - echo -n "." - fi - i=$(($i+1)) - sleep 2 - fi - done - fi -} - # Stupid hack to keep lintian happy. (Warrk! Stupidhack!). case $1 in start) @@ -201,9 +173,10 @@ case $1 in else log_daemon_msg "Restarting web server" "apache2" fi - if ! apache_sync_stop; then + if ! apache_stop; then log_end_msg 1 || true fi + sleep 10 if $APACHE2CTL start; then if check_htcacheclean ; then start_htcacheclean || log_end_msg 1 diff --git a/debian/changelog b/debian/changelog index 261fb80d..e11ad7d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,14 +1,16 @@ apache2 (2.2.6-2) UNRELEASED; urgency=low - * Since graceful-stop is not working reliably, use stop in the init script - instead. For restart, we also have to merge the logic to wait until apache - is dead from 2.2.4-3+etch3. This is a partial workaround for #445263. + * Avoid calling apr_pollset_poll() and accept_func() when the listening + sockets have already been closed on graceful stop or reload. This + hopefully fixes processes not being killed (closes: #445263, #447164) + and the "Bad file descriptor: apr_socket_accept: (client socket)" + error message (closes: #400918, #443310) * Allow logresolve to process long lines (Closes: #331631) * Remove duplicate config examples (Closes: #294662) * Include README.backtrace describing how to create a backtrace * Add CVE reference to 2.2.6-1 changelog entry - -- Stefan Fritsch <sf@debian.org> Mon, 15 Oct 2007 22:49:04 +0200 + -- Stefan Fritsch <sf@debian.org> Thu, 18 Oct 2007 19:35:40 +0200 apache2 (2.2.6-1) unstable; urgency=low diff --git a/debian/patches/00list b/debian/patches/00list index cc79fc44..4c3d9530 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -15,6 +15,6 @@ 046_proxy_ftp_dirparse_crash.dpatch 047_fix_usage_message.dpatch 050_enhance_apache2ctl.dpatch -051Bad_file_descriptor_PR42829.dpatch 099_config_guess_sub_update 052_logresolve_linelength.dpatch +053_bad_file_descriptor_PR42829.dpatch diff --git a/debian/patches/053_bad_file_descriptor_PR42829.dpatch b/debian/patches/053_bad_file_descriptor_PR42829.dpatch new file mode 100755 index 00000000..b7c46262 --- /dev/null +++ b/debian/patches/053_bad_file_descriptor_PR42829.dpatch @@ -0,0 +1,38 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 053_bad_file_descriptor_PR42829.dpatch by Stefan Fritsch <sf@debian.org> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix "Bad file descriptor" error on graceful reload +## DP: and processes not being killed on graceful stop + +@DPATCH@ +--- a/server/mpm/prefork/prefork.c-dist 2007-07-17 16:48:25.000000000 +0200 ++++ b/server/mpm/prefork/prefork.c 2007-10-18 14:23:49.698231000 +0200 +@@ -570,6 +570,11 @@ + apr_int32_t numdesc; + const apr_pollfd_t *pdesc; + ++ if (die_now) { ++ status = !APR_SUCCESS; ++ goto unlock; ++ } ++ + /* timeout == -1 == wait forever */ + status = apr_pollset_poll(pollset, -1, &numdesc, &pdesc); + if (status != APR_SUCCESS) { +@@ -618,8 +623,14 @@ + /* if we accept() something we don't want to die, so we have to + * defer the exit + */ +- status = lr->accept_func(&csd, lr, ptrans); ++ if (!die_now) { ++ status = lr->accept_func(&csd, lr, ptrans); ++ } ++ else { ++ status = !APR_SUCCESS; ++ } + ++ unlock: + SAFE_ACCEPT(accept_mutex_off()); /* unlock after "accept" */ + + if (status == APR_EGENERAL) { |