From: David Reid Date: Tue, 25 Dec 2001 12:24:14 +0000 (+0000) Subject: Add ap_os_killpg as well as unixd_killpg and beosd_killpg. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=059c262b200ea4f49e8526593a1f9245cc3d01cf;p=apache Add ap_os_killpg as well as unixd_killpg and beosd_killpg. Move the worker MPM to use ap_os_killpg in place of unixd_killpg as this makes it more portable. Ryan notes that really we should be using the POD mechanism to control death of the child processes, so this is temporary until we have that change in place. Note added to STATUS to that effect. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92598 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 585d122aeb..4ab15fdebe 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2001/12/24 13:24:30 $] +Last modified at [$Date: 2001/12/25 12:24:14 $] Release: @@ -348,6 +348,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: -0: Aaron (premature decision, needs more discussion) -0: Cliff (I think the default config should be the safest possible) + * Fix the worker MPM to use POD to kill child processes instead + of ap_os_killpg, regardless of how they should die. (Ryan Bloom) + PRs that have been suspended forever waiting for someone to put them into 'the next release': diff --git a/os/beos/beosd.h b/os/beos/beosd.h index b507f2b912..28e47eece5 100644 --- a/os/beos/beosd.h +++ b/os/beos/beosd.h @@ -91,6 +91,7 @@ AP_DECLARE(apr_status_t) beosd_accept(void **accepted, ap_listen_rec *lr, apr_pool_t *ptrans); #define beosd_killpg(x, y) (kill (-(x), (y))) +#define ap_os_killpg(x, y) (kill (-(x), (y))) #define BEOS_DAEMON_COMMANDS \ AP_INIT_TAKE1("User", beosd_set_user, NULL, RSRC_CONF, \ diff --git a/os/unix/unixd.h b/os/unix/unixd.h index ef906feca4..21f1f0f3f0 100644 --- a/os/unix/unixd.h +++ b/os/unix/unixd.h @@ -125,8 +125,10 @@ AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr, apr_po #ifdef HAVE_KILLPG #define unixd_killpg(x, y) (killpg ((x), (y))) +#define ap_os_killpg(x, y) (killpg ((x), (y))) #else /* HAVE_KILLPG */ #define unixd_killpg(x, y) (kill (-(x), (y))) +#define ap_os_killpg(x, y) (kill (-(x), (y))) #endif /* HAVE_KILLPG */ #define UNIX_DAEMON_COMMANDS \ diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 872ada2be3..aeebad24ba 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -1466,7 +1466,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) */ wake_up_and_die(); - if (unixd_killpg(getpgrp(), SIGTERM) < 0) { + if (ap_os_killpg(getpgrp(), SIGTERM) < 0) { ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGTERM"); } @@ -1521,7 +1521,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) * and a SIGHUP, we may as well use the same signal, because some user * pthreads are stealing signals from us left and right. */ - if (unixd_killpg(getpgrp(), SIGTERM) < 0) { + if (ap_os_killpg(getpgrp(), SIGTERM) < 0) { ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGTERM"); }