From f2491536ddce78da930ef5ef2130bca0546643ad Mon Sep 17 00:00:00 2001 From: Unbit Date: Wed, 18 Sep 2013 11:20:55 +0200 Subject: [PATCH] implemented fifo command P --- core/fifo.c | 1 + core/uwsgi.c | 9 +++++++++ uwsgi.h | 1 + 3 files changed, 11 insertions(+) diff --git a/core/fifo.c b/core/fifo.c index 2ed66980..d7d353d4 100644 --- a/core/fifo.c +++ b/core/fifo.c @@ -30,6 +30,7 @@ void uwsgi_master_fifo_prepare() { uwsgi_fifo_table['l'] = uwsgi_log_reopen; uwsgi_fifo_table['L'] = uwsgi_log_rotate; uwsgi_fifo_table['p'] = suspend_resume_them_all; + uwsgi_fifo_table['P'] = uwsgi_update_pidfiles; uwsgi_fifo_table['Q'] = kill_them_all; uwsgi_fifo_table['r'] = grace_them_all; uwsgi_fifo_table['R'] = reap_them_all; diff --git a/core/uwsgi.c b/core/uwsgi.c index cc061ff9..fd5b07b0 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -4535,3 +4535,12 @@ void uwsgi_print_sym(char *opt, char *symbol, void *foobar) { exit(0); } + +void uwsgi_update_pidfiles() { + if (uwsgi.pidfile) { + uwsgi_write_pidfile(uwsgi.pidfile); + } + if (uwsgi.pidfile2) { + uwsgi_write_pidfile(uwsgi.pidfile2); + } +} diff --git a/uwsgi.h b/uwsgi.h index 4fa5a17c..f859bf6a 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -4325,6 +4325,7 @@ void uwsgi_log_reopen(); void uwsgi_reload_workers(); void uwsgi_chain_reload(); void uwsgi_refork_master(); +void uwsgi_update_pidfiles(); #ifdef __cplusplus }