LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   on-error-execute freshclam clamav-0.95 (https://www.linuxquestions.org/questions/linux-software-2/on-error-execute-freshclam-clamav-0-95-a-757682/)

rob07mxa 09-25-2009 04:25 AM

on-error-execute freshclam clamav-0.95
 
hi

i am trying to lunch /var/log/freshclam.log when there is an error during updating the anti-virus database. therefore, i am trying to use the option –on-error-execute to open the above file.

i introduced an error by changing the location of one of the configuration file, the error get printed to the terminal, but the --on-error -execute did not open the log file.

# freshclam --on-error-execute=”gedit /var/log/freshclam.log”
ClamAV update process started at Thu Sep 24 17:38:55 2009
main.cvd is up to date (version: 51, sigs: 545035, f-level: 42, builder: sven)
daily.cld is up to date (version: 9833, sigs: 79627, f-level: 43, builder: mcichosz)
ERROR: SubmitDetectionStats: Can't open or parse configuration file /usr/local/etc/clamd.conf

enabling OnErrorExecute directive in freshclam.conf file also did not solve the problem.
# Run command when database update process fails.
# Default: disabled
OnErrorExecute command

entering a real command (/bin/pwd) instead of the command placeholder (a string without space):
OnErrorExecute/bin/pwd

and running freshclam without on-error-execute option
# freshclam
ClamAV update process started at Thu Sep 24 17:38:55 2009
main.cvd is up to date (version: 51, sigs: 545035, f-level: 42, builder: sven)
daily.cld is up to date (version: 9833, sigs: 79627, f-level: 43, builder: mcichosz)
ERROR: SubmitDetectionStats: Can't open or parse configuration file /usr/local/etc/clamd.conf

also did not solve the problem

Why on-error-execute option is not working when there is an error during database update?
What are the suggestions to make it work?


thanks

arphaxad 10-01-2009 03:41 AM

Having done a little testing, it seems as if the --on-error-execute
option will only run the specified command if the database update has failed (for example, because the update servers couldn't be reached or the files were corrupted) not if some other error has occurred. In your case, the update appears to have worked correctly; the error was that the SubmitDetectionStats directive in freshclam.conf was still pointing at the old file location.

I think --on-error-execute (and --on-update-execute and --on-outdated-execute and the corresponding directives in freshclam.conf) are aimed mainly at systems where the updating is automated by cron job, to warn the sys admin when the update has failed (or worked, or the clamav version is out of date)and the command executed would normally be a mail command.

Arphaxad


All times are GMT -5. The time now is 08:17 PM.