added --touch-chain-reload

This commit is contained in:
Unbit
2013-02-11 20:10:43 +01:00
parent 669c14ac71
commit c226feaeca
3 changed files with 16 additions and 0 deletions
+14
View File
@@ -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;
+1
View File
@@ -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},
+1
View File
@@ -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;