From: Colm MacCarthaigh Date: Tue, 23 Aug 2005 16:41:17 +0000 (+0000) Subject: Remove support for the threaded-mpm's on Linux 2.0, and de-autoconf the X-Git-Tag: 2.3.0~3102 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=395896ae8d19bbea10f82b1d40e16f4721d316b7;p=apache Remove support for the threaded-mpm's on Linux 2.0, and de-autoconf the graceful restart signal. Frees up SIGWINCH for implementing graceful stop. See <20050727114058.GA3390@stdlib.net> and subsequent thread on httpd-dev. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239430 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index f99b9019b9..4ee01b961e 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] + *) Linux 2.0: remove support for threaded MPM's due to linuxthreads use + of SIGUSR1 clashing with graceful restart signal. [Colm MacCarthaigh] + *) mod_cache: Enhance CacheEnable/CacheDisable to control caching on a per-protocol, per-host and per-path basis. Intended for proxy configurations. [Colm MacCarthaigh] diff --git a/configure.in b/configure.in index afcf14257d..18008727ab 100644 --- a/configure.in +++ b/configure.in @@ -232,8 +232,6 @@ esac APACHE_SUBST(SHLTCFLAGS) APACHE_SUBST(LTCFLAGS) -AP_SIG_GRACEFUL=USR1 - case $host in *-apple-aux3*) APR_SETVAR(APACHE_MPM, [prefork]) @@ -249,9 +247,6 @@ case $host in ;; *-linux-*) case `uname -r` in - 2.0* ) - AP_SIG_GRACEFUL=WINCH - ;; 2.[[2-9]]* ) APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; @@ -575,14 +570,6 @@ if test "$AP_NONBLOCK_WHEN_MULTI_LISTEN" = "1"; then [Listening sockets are non-blocking when there are more than 1]) fi -AC_DEFINE_UNQUOTED(AP_SIG_GRACEFUL, SIG$AP_SIG_GRACEFUL, [Signal used to gracefully restart]) -AC_DEFINE_UNQUOTED(AP_SIG_GRACEFUL_STRING, "SIG$AP_SIG_GRACEFUL", [Signal used to gracefully restart (as a quoted string)]) -AC_DEFINE_UNQUOTED(AP_SIG_GRACEFUL_SHORT, $AP_SIG_GRACEFUL, [Signal used to gracefully restart (without SIG prefix)]) -AP_SIG_GRACEFUL_SHORT=$AP_SIG_GRACEFUL -AP_SIG_GRACEFUL=SIG$AP_SIG_GRACEFUL_SHORT -AC_SUBST(AP_SIG_GRACEFUL) -AC_SUBST(AP_SIG_GRACEFUL_STRING) -AC_SUBST(AP_SIG_GRACEFUL_SHORT) APACHE_FAST_OUTPUT(Makefile modules/Makefile srclib/Makefile) APACHE_FAST_OUTPUT(os/Makefile server/Makefile) diff --git a/include/mpm_common.h b/include/mpm_common.h index a36b926ff5..161b48e486 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -56,6 +56,15 @@ extern "C" { #define DEFAULT_LISTENBACKLOG 511 #endif +/* Signal used to gracefully restart */ +#define AP_SIG_GRACEFUL SIGUSR1 + +/* Signal used to gracefully restart (without SIG prefix) */ +#define AP_SIG_GRACEFUL_SHORT USR1 + +/* Signal used to gracefully restart (as a quoted string) */ +#define AP_SIG_GRACEFUL_STRING "SIGUSR1" + /** * Make sure all child processes that have been spawned by the parent process * have died. This includes process registered as "other_children". diff --git a/server/mpm/config.m4 b/server/mpm/config.m4 index f8b2022cdd..34018382e1 100644 --- a/server/mpm/config.m4 +++ b/server/mpm/config.m4 @@ -38,6 +38,22 @@ if ap_mpm_is_threaded; then AC_MSG_CHECKING(checking for replacement) AC_MSG_RESULT(prefork selected) apache_cv_mpm=prefork + else + case $host in + *-linux-*) + case `uname -r` in + 2.0* ) + dnl Threaded MPM's are not supported on Linux 2.0 + dnl as on 2.0 the linuxthreads library uses SIGUSR1 + dnl and SIGUSR2 internally + echo "Threaded MPM's are not supported on this platform" + AC_MSG_CHECKING(checking for replacement) + AC_MSG_RESULT(prefork selected) + apache_cv_mpm=prefork + ;; + esac + ;; + esac fi fi diff --git a/server/mpm_common.c b/server/mpm_common.c index 8554c52e6b..93711f7c19 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -917,7 +917,7 @@ int ap_signal_server(int *exit_status, apr_pool_t *pconf) printf("httpd not running, trying to start\n"); } else { - *exit_status = send_signal(otherpid, SIGUSR1); + *exit_status = send_signal(otherpid, AP_SIG_GRACEFUL); return 1; } }