diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-04-11 18:23:58 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-04-11 18:23:58 +0300 |
commit | da61cfd98b19903d54d4d54750c2ab375b0da76f (patch) | |
tree | 973b6a4a9fb5c531612a2f36867447febb107c6b /src/nxt_main_process.c | |
parent | 204c39472166440f54435edcef8d286f429e0aae (diff) | |
download | unit-da61cfd98b19903d54d4d54750c2ab375b0da76f.tar.gz unit-da61cfd98b19903d54d4d54750c2ab375b0da76f.tar.bz2 |
Access log reopening.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_main_process.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/nxt_main_process.c b/src/nxt_main_process.c index c6caaf56..46f49a72 100644 --- a/src/nxt_main_process.c +++ b/src/nxt_main_process.c @@ -698,20 +698,28 @@ nxt_main_process_sigusr1_handler(nxt_task_t *task, void *obj, void *data) nxt_mp_t *mp; nxt_int_t ret; nxt_uint_t n; + nxt_port_t *port; nxt_file_t *file, *new_file; - nxt_runtime_t *rt; nxt_array_t *new_files; + nxt_runtime_t *rt; nxt_log(task, NXT_LOG_NOTICE, "signal %d (%s) recevied, %s", (int) (uintptr_t) obj, data, "log files rotation"); + rt = task->thread->runtime; + + port = rt->port_by_type[NXT_PROCESS_ROUTER]; + + if (nxt_fast_path(port != NULL)) { + (void) nxt_port_socket_write(task, port, NXT_PORT_MSG_ACCESS_LOG, + -1, 0, 0, NULL); + } + mp = nxt_mp_create(1024, 128, 256, 32); if (mp == NULL) { return; } - rt = task->thread->runtime; - n = nxt_list_nelts(rt->log_files); new_files = nxt_array_create(mp, n, sizeof(nxt_file_t)); |