From 71cd2f7ce705561d8d8f3cb7f385a57bedad1ef1 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 24 Feb 2010 18:58:15 +0100 Subject: Reopen logs when SIGHUP is caught Upon receiving SIGHUP, the monitor signals all services to reopen their debug logs. It is also possible to signal individual services to reopen their particular files. Fixes: #332 --- src/util/debug.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/util/debug.c') diff --git a/src/util/debug.c b/src/util/debug.c index d26d31c9..5b6fccd6 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -152,3 +152,16 @@ int open_debug_file(void) { return open_debug_file_ex(NULL, NULL); } + +int rotate_debug_files(void) +{ + int ret; + + if (!debug_to_file) return EOK; + + ret = fclose(debug_file); + if (ret) return ret; + debug_file = NULL; + + return open_debug_file(); +} -- cgit