From: Eric Covener Date: Mon, 29 Nov 2010 00:10:22 +0000 (+0000) Subject: PR50350: When no -k option is provided on the httpd command line, the server X-Git-Tag: 2.3.10~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d185fd5f57ea4d81d0acc7a9ee373b714c57a761;p=thirdparty%2Fapache%2Fhttpd.git PR50350: When no -k option is provided on the httpd command line, the server was starting without checking for an existing pidfile. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039989 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 3e6d875abfc..03302dbf92b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.3.10 + *) httpd: When no -k option is provided on the httpd command line, the server + was starting without checking for an existing pidfile. PR 50350 + [Eric Covener] + *) mod_proxy: Put the worker in error state if the SSL handshake with the backend fails. PR 50332. [Daniel Ruggeri , Ruediger Pluem] diff --git a/server/mpm_unix.c b/server/mpm_unix.c index 81abbb1a2ad..c0620191cb9 100644 --- a/server/mpm_unix.c +++ b/server/mpm_unix.c @@ -610,6 +610,7 @@ void ap_mpm_pod_killpg(ap_pod_t *pod, int num) } static const char *dash_k_arg = NULL; +static const char *dash_k_arg_noarg = "noarg"; static int send_signal(pid_t pid, int sig) { @@ -656,7 +657,7 @@ int ap_signal_server(int *exit_status, apr_pool_t *pconf) } } - if (!strcmp(dash_k_arg, "start")) { + if (!strcmp(dash_k_arg, "start") || dash_k_arg == dash_k_arg_noarg) { if (running) { printf("%s\n", status); return 1; @@ -755,10 +756,12 @@ void ap_mpm_rewrite_args(process_rec *process) process->argc = mpm_new_argv->nelts; process->argv = (const char * const *)mpm_new_argv->elts; - - if (dash_k_arg) { - APR_REGISTER_OPTIONAL_FN(ap_signal_server); + + if (NULL == dash_k_arg) { + dash_k_arg = dash_k_arg_noarg; } + + APR_REGISTER_OPTIONAL_FN(ap_signal_server); } static pid_t parent_pid, my_pid;