summaryrefslogtreecommitdiffstats
path: root/server/mpm
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2002-04-05 02:34:22 +0200
committerJeff Trawick <trawick@apache.org>2002-04-05 02:34:22 +0200
commit3f396cfdbc53d183eb09b68fb83a95d2c06e12c8 (patch)
treee65908f5bdbc4037e203becc7ba68c235c794445 /server/mpm
parentworker MPM: add -DFOREGROUND option to use when you want (diff)
downloadapache2-3f396cfdbc53d183eb09b68fb83a95d2c06e12c8.tar.xz
apache2-3f396cfdbc53d183eb09b68fb83a95d2c06e12c8.zip
implement FOREGROUND for perchild and beos MPMs too
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94442 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm')
-rw-r--r--server/mpm/beos/beos.c10
-rw-r--r--server/mpm/experimental/perchild/perchild.c7
-rw-r--r--server/mpm/perchild/perchild.c7
3 files changed, 14 insertions, 10 deletions
diff --git a/server/mpm/beos/beos.c b/server/mpm/beos/beos.c
index 9df32c06e3..d6e4d72fd0 100644
--- a/server/mpm/beos/beos.c
+++ b/server/mpm/beos/beos.c
@@ -1000,24 +1000,26 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
static int beos_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
{
static int restart_num = 0;
- int no_detach, debug;
+ int no_detach, debug, foreground;
apr_status_t rv;
debug = ap_exists_config_define("DEBUG");
- if (debug)
- no_detach = one_process = 1;
+ if (debug) {
+ foreground = one_process = 1;
+ }
else
{
one_process = ap_exists_config_define("ONE_PROCESS");
no_detach = ap_exists_config_define("NO_DETACH");
+ foreground = ap_exists_config_define("FOREGROUND");
}
/* sigh, want this only the second time around */
if (restart_num++ == 1) {
is_graceful = 0;
- if (!one_process) {
+ if (!one_process && !foreground) {
rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND
: APR_PROC_DETACH_DAEMONIZE);
if (rv != APR_SUCCESS) {
diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c
index b6b0ed7c27..c41afc3acb 100644
--- a/server/mpm/experimental/perchild/perchild.c
+++ b/server/mpm/experimental/perchild/perchild.c
@@ -1454,7 +1454,7 @@ static int perchild_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp
static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
{
static int restart_num = 0;
- int no_detach, debug;
+ int no_detach, debug, foreground;
ap_directive_t *pdir;
int i;
int tmp_server_limit = DEFAULT_SERVER_LIMIT;
@@ -1464,18 +1464,19 @@ static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptem
debug = ap_exists_config_define("DEBUG");
if (debug) {
- no_detach = one_process = 1;
+ foreground = one_process = 1;
}
else {
one_process = ap_exists_config_define("ONE_PROCESS");
no_detach = ap_exists_config_define("NO_DETACH");
+ foreground = ap_exists_config_define("FOREGROUND");
}
/* sigh, want this only the second time around */
if (restart_num++ == 1) {
is_graceful = 0;
- if (!one_process) {
+ if (!one_process && !foreground) {
rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND
: APR_PROC_DETACH_DAEMONIZE);
if (rv != APR_SUCCESS) {
diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c
index b6b0ed7c27..c41afc3acb 100644
--- a/server/mpm/perchild/perchild.c
+++ b/server/mpm/perchild/perchild.c
@@ -1454,7 +1454,7 @@ static int perchild_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp
static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
{
static int restart_num = 0;
- int no_detach, debug;
+ int no_detach, debug, foreground;
ap_directive_t *pdir;
int i;
int tmp_server_limit = DEFAULT_SERVER_LIMIT;
@@ -1464,18 +1464,19 @@ static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptem
debug = ap_exists_config_define("DEBUG");
if (debug) {
- no_detach = one_process = 1;
+ foreground = one_process = 1;
}
else {
one_process = ap_exists_config_define("ONE_PROCESS");
no_detach = ap_exists_config_define("NO_DETACH");
+ foreground = ap_exists_config_define("FOREGROUND");
}
/* sigh, want this only the second time around */
if (restart_num++ == 1) {
is_graceful = 0;
- if (!one_process) {
+ if (!one_process && !foreground) {
rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND
: APR_PROC_DETACH_DAEMONIZE);
if (rv != APR_SUCCESS) {