From c4edd3565500719edae5c077f742a3f56afb1e15 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Wed, 13 Apr 2016 02:30:20 -0400 Subject: [PATCH] skip spawning backends for preflight tests (#2642) Also, update man page for lighttpd -tt x-ref: "add option for "fail on warning"" https://redmine.lighttpd.net/issues/2642 --- doc/lighttpd.8 | 3 +++ src/mod_fastcgi.c | 3 ++- src/mod_scgi.c | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/lighttpd.8 b/doc/lighttpd.8 index a5954ed9..e573a0d3 100644 --- a/doc/lighttpd.8 +++ b/doc/lighttpd.8 @@ -33,6 +33,9 @@ Print the parsed configuration file in its internal form and exit. \fB\-t\fP Test the configuration file for syntax errors and exit. .TP 8 +\fB\-tt\fP +Test the configuration file for syntax errors, load and initialize modules, and exit. +.TP 8 \fB\-D\fP Do not daemonize (go into background). The default is to daemonize. .TP 8 diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c index 8ab215a4..26f68385 100644 --- a/src/mod_fastcgi.c +++ b/src/mod_fastcgi.c @@ -1429,7 +1429,8 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) { "\n\tcurrent:", pno, "/", host->max_procs); } - if (fcgi_spawn_connection(srv, p, host, proc)) { + if (!srv->srvconf.preflight_check + && fcgi_spawn_connection(srv, p, host, proc)) { log_error_write(srv, __FILE__, __LINE__, "s", "[ERROR]: spawning fcgi failed."); fastcgi_process_free(proc); diff --git a/src/mod_scgi.c b/src/mod_scgi.c index a4a8e0ac..4e194fed 100644 --- a/src/mod_scgi.c +++ b/src/mod_scgi.c @@ -1191,7 +1191,8 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) { "\n\tcurrent:", pno, "/", df->min_procs); } - if (scgi_spawn_connection(srv, p, df, proc)) { + if (!srv->srvconf.preflight_check + && scgi_spawn_connection(srv, p, df, proc)) { log_error_write(srv, __FILE__, __LINE__, "s", "[ERROR]: spawning fcgi failed."); scgi_process_free(proc);