From 7720a70dc4594883bd1040ba97241baa28cb38b9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 24 Mar 2009 20:52:10 +0000 Subject: [PATCH] axe the remaining checks of AP_MPM_WANT_foo to see what code to generate MPMs no longer provide those definitions (the signal server support is an interesting problem, since it has to be known before loading loading the MPM) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758014 13f79535-47bb-0310-9956-ffa450edef68 --- include/http_main.h | 1 - include/mpm_common.h | 8 -------- modules/arch/unix/mod_unixd.c | 4 ---- server/core.c | 21 +++------------------ server/main.c | 11 +++-------- 5 files changed, 6 insertions(+), 39 deletions(-) diff --git a/include/http_main.h b/include/http_main.h index 38739496ef..545ba5ac13 100644 --- a/include/http_main.h +++ b/include/http_main.h @@ -60,7 +60,6 @@ AP_DECLARE_DATA extern apr_array_header_t *ap_server_config_defines; /** * An optional function to send signal to server on presence of '-k' * command line argument. - * Called if MPM defines AP_MPM_WANT_SIGNAL_SERVER * @param status The exit status after sending signal * @param pool Memory pool to allocate from */ diff --git a/include/mpm_common.h b/include/mpm_common.h index ebf193ad6b..9c0eeed6dd 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -92,8 +92,6 @@ extern "C" { /** * Make sure all child processes that have been spawned by the parent process * have died. This includes process registered as "other_children". - * @warning This is only defined if the MPM defines - * AP_MPM_WANT_RECLAIM_CHILD_PROCESSES * @param terminate Either 1 or 0. If 1, send the child processes SIGTERM * each time through the loop. If 0, give the process time to die * on its own before signalling it. @@ -112,8 +110,6 @@ void ap_reclaim_child_processes(int terminate); /** * Catch any child processes that have been spawned by the parent process * which have exited. This includes processes registered as "other_children". - * @warning This is only defined if the MPM defines - * AP_MPM_WANT_RECLAIM_CHILD_PROCESSES * @tip This function requires that some macros are defined by the MPM:
  *  MPM_CHILD_PID -- Get the pid from the specified spot in the scoreboard
  *  MPM_NOTE_CHILD_KILLED -- Note the child died in the scoreboard
@@ -129,8 +125,6 @@ void ap_relieve_child_processes(void);
 /**
  * Tell ap_reclaim_child_processes() and ap_relieve_child_processes() about 
  * an MPM child process which has no entry in the scoreboard.
- * @warning This is only defined if the MPM defines
- *          AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
  * @param pid The process id of an MPM child process which should be
  * reclaimed when ap_reclaim_child_processes() is called.
  * @tip If an extra MPM child process terminates prior to calling
@@ -144,8 +138,6 @@ void ap_register_extra_mpm_process(pid_t pid);
 /**
  * Unregister an MPM child process which was previously registered by a
  * call to ap_register_extra_mpm_process().
- * @warning This is only defined if the MPM defines
- *          AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
  * @param pid The process id of an MPM child process which no longer needs to
  * be reclaimed.
  * @return 1 if the process was found and removed, 0 otherwise
diff --git a/modules/arch/unix/mod_unixd.c b/modules/arch/unix/mod_unixd.c
index 96e27a5dbf..a33cf4bd99 100644
--- a/modules/arch/unix/mod_unixd.c
+++ b/modules/arch/unix/mod_unixd.c
@@ -203,7 +203,6 @@ unixd_drop_privileges(apr_pool_t *pool, server_rec *s)
     }
 #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
     /* this applies to Linux 2.4+ */
-#ifdef AP_MPM_WANT_SET_COREDUMPDIR
     if (ap_coredumpdir_configured) {
         if (prctl(PR_SET_DUMPABLE, 1)) {
             rv = errno;
@@ -214,7 +213,6 @@ unixd_drop_privileges(apr_pool_t *pool, server_rec *s)
         }
     }
 #endif
-#endif
 #endif
 
     return OK;
@@ -359,7 +357,6 @@ AP_DECLARE(int) ap_unixd_setup_child(void)
     }
 #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
     /* this applies to Linux 2.4+ */
-#ifdef AP_MPM_WANT_SET_COREDUMPDIR
     if (ap_coredumpdir_configured) {
         if (prctl(PR_SET_DUMPABLE, 1)) {
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
@@ -368,7 +365,6 @@ AP_DECLARE(int) ap_unixd_setup_child(void)
         }
     }
 #endif
-#endif
 #endif
     return 0;
 }
diff --git a/server/core.c b/server/core.c
index 05319060cc..6d9bfad108 100644
--- a/server/core.c
+++ b/server/core.c
@@ -3361,41 +3361,26 @@ AP_INIT_FLAG("AllowEncodedSlashes", set_allow2f, NULL, RSRC_CONF,
 
 /*
  * These are default configuration directives that mpms can/should
- * pay attention to. If an mpm wishes to use these, they should
- * #defined them in mpm.h.
+ * pay attention to.
+ * XXX These are not for all platforms, and even some Unix MPMs might not want
+ * some directives.
  */
-#ifdef AP_MPM_WANT_SET_PIDFILE
 AP_INIT_TAKE1("PidFile",  ap_mpm_set_pidfile, NULL, RSRC_CONF,
               "A file for logging the server process ID"),
-#endif
-#ifdef AP_MPM_WANT_SET_SCOREBOARD
 AP_INIT_TAKE1("ScoreBoardFile", ap_mpm_set_scoreboard, NULL, RSRC_CONF,
               "A file for Apache to maintain runtime process management information"),
-#endif
-#ifdef AP_MPM_WANT_SET_LOCKFILE
 AP_INIT_TAKE1("LockFile",  ap_mpm_set_lockfile, NULL, RSRC_CONF,
               "The lockfile used when Apache needs to lock the accept() call (deprecated)"),
-#endif
-#ifdef AP_MPM_WANT_SET_MAX_REQUESTS
 AP_INIT_TAKE1("MaxRequestsPerChild", ap_mpm_set_max_requests, NULL, RSRC_CONF,
               "Maximum number of requests a particular child serves before dying."),
-#endif
-#ifdef AP_MPM_WANT_SET_COREDUMPDIR
 AP_INIT_TAKE1("CoreDumpDirectory", ap_mpm_set_coredumpdir, NULL, RSRC_CONF,
               "The location of the directory Apache changes to before dumping core"),
-#endif
-#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
 AP_INIT_TAKE1("AcceptMutex", ap_mpm_set_accept_lock_mech, NULL, RSRC_CONF,
               AP_AVAILABLE_MUTEXES_STRING),
-#endif
-#ifdef AP_MPM_WANT_SET_MAX_MEM_FREE
 AP_INIT_TAKE1("MaxMemFree", ap_mpm_set_max_mem_free, NULL, RSRC_CONF,
               "Maximum number of 1k blocks a particular childs allocator may hold."),
-#endif
-#ifdef AP_MPM_WANT_SET_STACKSIZE
 AP_INIT_TAKE1("ThreadStackSize", ap_mpm_set_thread_stacksize, NULL, RSRC_CONF,
               "Size in bytes of stack used by threads handling client connections"),
-#endif
 #if AP_ENABLE_EXCEPTION_HOOK
 AP_INIT_TAKE1("EnableExceptionHook", ap_mpm_set_exception_hook, NULL, RSRC_CONF,
               "Controls whether exception hook may be called after a crash"),
diff --git a/server/main.c b/server/main.c
index eb241b6873..c72eb580b1 100644
--- a/server/main.c
+++ b/server/main.c
@@ -372,17 +372,12 @@ static void usage(process_rec *process)
                  "       %s [-k install|config|uninstall] [-n service_name]",
                  pad);
 #endif
-#ifdef AP_MPM_WANT_SIGNAL_SERVER
-#ifdef AP_MPM_WANT_SET_GRACEFUL_SHUTDOWN
+/* XXX not all MPMs support signalling the server in general or graceful-stop
+ * in particular
+ */
     ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
                  "       %s [-k start|restart|graceful|graceful-stop|stop]",
                  pad);
-#else
-    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
-                 "       %s [-k start|restart|graceful|stop]",
-                 pad);
-#endif /* AP_MPM_WANT_SET_GRACEFUL_SHUTDOWN */
-#endif
     ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
                  "       %s [-v] [-V] [-h] [-l] [-L] [-t] [-S]", pad);
     ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
-- 
2.40.0