diff --git a/core/master.c b/core/master.c index 7972ebf1..e0501585 100644 --- a/core/master.c +++ b/core/master.c @@ -1158,7 +1158,21 @@ health_cycle: uwsgi_block_signal(SIGHUP); grace_them_all(0); uwsgi_unblock_signal(SIGHUP); + continue; } + touched = uwsgi_check_touches(uwsgi.touch_chain_reload); + if (touched) { + uwsgi_block_signal(SIGHUP); + uwsgi_log("*** %s has been touched... chain reload !!! ***\n", touched); + for(i=1;i<=uwsgi.numproc;i++) { + if (uwsgi.workers[i].pid > 0) { + kill(uwsgi.workers[i].pid, SIGHUP); + } + } + uwsgi_unblock_signal(SIGHUP); + continue; + } + } continue; diff --git a/core/uwsgi.c b/core/uwsgi.c index 445ff55f..73fc2d17 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -301,6 +301,7 @@ static struct uwsgi_option uwsgi_base_options[] = { #endif {"never-swap", no_argument, 0, "lock all memory pages avoiding swapping", uwsgi_opt_true, &uwsgi.never_swap, 0}, {"touch-reload", required_argument, 0, "reload uWSGI if the specified file is modified/touched", uwsgi_opt_add_string_list, &uwsgi.touch_reload, UWSGI_OPT_MASTER}, + {"touch-chain-reload", required_argument, 0, "trigger chain reload if the specified file is modified/touched", uwsgi_opt_add_string_list, &uwsgi.touch_chain_reload, UWSGI_OPT_MASTER}, {"touch-logrotate", required_argument, 0, "trigger logrotation if the specified file is modified/touched", uwsgi_opt_add_string_list, &uwsgi.touch_logrotate, UWSGI_OPT_MASTER | UWSGI_OPT_LOG_MASTER}, {"touch-logreopen", required_argument, 0, "trigger log reopen if the specified file is modified/touched", uwsgi_opt_add_string_list, &uwsgi.touch_logreopen, UWSGI_OPT_MASTER | UWSGI_OPT_LOG_MASTER}, {"propagate-touch", no_argument, 0, "over-engineering option for system with flaky signal mamagement", uwsgi_opt_true, &uwsgi.propagate_touch, 0}, diff --git a/uwsgi.h b/uwsgi.h index f6c5a008..93d93d37 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1840,6 +1840,7 @@ struct uwsgi_server { rlim_t evil_reload_on_rss; struct uwsgi_string_list *touch_reload; + struct uwsgi_string_list *touch_chain_reload; struct uwsgi_string_list *touch_logrotate; struct uwsgi_string_list *touch_logreopen;