diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-09-26 10:53:56 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-10-01 06:39:47 -0400 |
commit | 41c3cc0965ceeb9a79ef800b8c0578afdc4e452a (patch) | |
tree | 6b9bfcb66438e2e57596604d87c447ed19a0e0e4 /src/gw_backend.c | |
parent | ff45d5865efdf131ed77afb2eb540d992dcb21ab (diff) | |
download | lighttpd-git-41c3cc0965ceeb9a79ef800b8c0578afdc4e452a.tar.gz |
[core] disable server.graceful-restart-bg if spawn
disable server.graceful-restart-bg if spawning gateway backends
via *.server "bin-path"
Diffstat (limited to 'src/gw_backend.c')
-rw-r--r-- | src/gw_backend.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gw_backend.c b/src/gw_backend.c index 9dfeaad1..6fb826aa 100644 --- a/src/gw_backend.c +++ b/src/gw_backend.c @@ -1340,6 +1340,9 @@ int gw_set_defaults_backend(server *srv, gw_plugin_data *p, const array *a, gw_p gw_host *host = NULL; + int graceful_restart_bg = + config_feature_bool(srv, "server.graceful-restart-bg", 0); + p->srv_pid = srv->pid; s->exts = gw_extensions_init(); @@ -1705,6 +1708,23 @@ int gw_set_defaults_backend(server *srv, gw_plugin_data *p, const array *a, gw_p host->first = proc; ++host->num_procs; } + + if (graceful_restart_bg) { + /*(set flag to false to avoid repeating)*/ + graceful_restart_bg = 0; + log_error(srv->errh, __FILE__, __LINE__, + "server.graceful-restart-bg disabled " + "(incompatible with %s.server \"bin-path\")", + p->self->name); + data_unset * const du = + array_get_data_unset(srv->srvconf.feature_flags, + CONST_STR_LEN("server.graceful-restart-bg")); + if (du->type == TYPE_STRING) + buffer_copy_string_len(&((data_string *)du)->value, + CONST_STR_LEN("false")); + else /* (du->type == TYPE_INTEGER) */ + ((data_integer *)du)->value = 0; + } } else { gw_proc * const proc = gw_proc_init(host); host->first = proc; |