Control: tags -1 pending patch On 2010-05-11 23:58:23 [+0200], Dario wrote: > updates..
more udpates. Sebastian
>From b8d6680da56bdfdb979ee40f5e637a435b1cbe82 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <[email protected]> Date: Thu, 9 Jul 2015 00:06:38 +0200 Subject: explict reopen logfiles on SIGUSR1 The init script sends a SIGHUP to the main process. The main process sends a SIGUSR1 to all its childs. The child process should restart which happens but not immediately. This patch re-opens the logfiles from within the signal handler so the old files (after a rename) are no longer in use. signal(7) allows to use open() and close() from within the signal handler. https://bugs.debian.org/524045 Signed-off-by: Sebastian Andrzej Siewior <[email protected]> --- havp/helper.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/havp/helper.cpp b/havp/helper.cpp index 031cb10..158220d 100644 --- a/havp/helper.cpp +++ b/havp/helper.cpp @@ -53,10 +53,18 @@ static void RereadAll( int SignalNo ) rereadall = true; } +static void ReopenLogFiles( int SignalNo ) +{ + LogFile::InitLogFiles(Params::GetConfigString("ACCESSLOG").c_str(), + Params::GetConfigString("VIRUSLOG").c_str(), + Params::GetConfigString("ERRORLOG").c_str()); +} + static void RestartChild( int SignalNo ) { extern bool childrestart; childrestart = true; + ReopenLogFiles(SignalNo); } static void ExitProcess( int SignalNo ) @@ -131,7 +139,7 @@ int InstallSignal( int level ) } else if ( level == 2 ) //Scanner Process { - Signal.sa_handler = SIG_IGN; + Signal.sa_handler = ReopenLogFiles; if (sigaction(SIGUSR1, &Signal, NULL) != 0) return -1; }
_______________________________________________ Pkg-clamav-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-clamav-devel
