Ian Abbott wrote:
On 02/01/07 12:12, Rolf E. Sonneveld wrote:
According to the monitoring system, the freshclam process disappeared
between 14:29 and 14:34. Running ClamAV on Solaris 9. Any idea why
after a 'connection refused' or 'connection timed out' the freshclam
process dies?
It would be nice if there was an option to run freshclam as a
"foreground daemon" so you could monitor its exit status, but there
isn't. My guess is that it's receiving a signal whose current action
is set to kill the process.
The signal handling for SIGALRM and SIGUSR1 in freshclam.c's main()
function is a bit buggy. It sets the following actions in the main loop:
sigaction(SIGALRM, &sigact, &oldact);
sigaction(SIGUSR1, &sigact, &oldact);
then later on:
sigaction(SIGALRM, &oldact, NULL);
sigaction(SIGUSR1, &oldact, NULL);
There are two problems here. The two signals shouldn't really be
using the same variable 'oldact', even though the default action for
both signals is the same. The other problem is that the program
spends some of its time with the SIGALRM and SIGUSR1 signals set to
the default action, which is to terminate the process. In fact, the
more I look at the main loop of the freshclam daemon, the worse it
gets! It may catch SIGHUP and set the 'terminate' variable at the
wrong time, causing the main loop to exit prematurely, or it may fail
to catch 'SIGALRM' or 'SIGUSR1' some of the time, causing the process
to terminate with that signal.
Thanks, Ian. This sounds interesting. If I understand you correctly,
this can be related to the problem we see, with the disappearing
freshclam daemon process? I'm not a programmer so I'm afraid I can't
contribute code here; also, I'm not familiar with the way ClamAV
changes/fixes are done. Is anyone in charge of the freshclam code?
I'd be happy to test changes in the code; and if I can increase the
debugging level I'd be happy to send feedback to the list with
debug/logging information.
/rolf
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html