From 8ee82fc29623195bf4e3fdada228e5e224b7478e Mon Sep 17 00:00:00 2001 From: unbit Date: Wed, 4 Sep 2013 12:28:22 +0200 Subject: [PATCH] do not call pre-jail on reload --- core/uwsgi.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/core/uwsgi.c b/core/uwsgi.c index f73f4f3f..5f4865f4 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -2196,21 +2196,23 @@ int main(int argc, char *argv[], char *envp[]) { uwsgi_emperor_start(); } - // run the pre-jail scripts - struct uwsgi_string_list *usl = uwsgi.exec_pre_jail; - while (usl) { - uwsgi_log("running \"%s\" (pre-jail)...\n", usl->value); - int ret = uwsgi_run_command_and_wait(NULL, usl->value); - if (ret != 0) { - uwsgi_log("command \"%s\" exited with non-zero code: %d\n", usl->value, ret); - exit(1); + if (!uwsgi.reloads) { + // run the pre-jail scripts + struct uwsgi_string_list *usl = uwsgi.exec_pre_jail; + while (usl) { + uwsgi_log("running \"%s\" (pre-jail)...\n", usl->value); + int ret = uwsgi_run_command_and_wait(NULL, usl->value); + if (ret != 0) { + uwsgi_log("command \"%s\" exited with non-zero code: %d\n", usl->value, ret); + exit(1); + } + usl = usl->next; } - usl = usl->next; - } - uwsgi_foreach(usl, uwsgi.call_pre_jail) { - if (uwsgi_call_symbol(usl->value)) { - uwsgi_log("unaable to call function \"%s\"\n", usl->value); + uwsgi_foreach(usl, uwsgi.call_pre_jail) { + if (uwsgi_call_symbol(usl->value)) { + uwsgi_log("unaable to call function \"%s\"\n", usl->value); + } } }