Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-2009, 04:57 AM
Elite Member
 
Posts: 296
Default clamav and freshclam

I have following issue with one installation.
I have implemented a hot/cold stategy to rsync /opt/zimbra to a dr site.
Every night, when restarting zimbra, due to peering band issues (they have 2 megabits with colt and band generally is not an issue, maybe clamav mirrors have a poor peering with colt in italy), freshclam is not able to refresh clam daily db, clamav does not start, mta does not deliver messages and so on.

What I would is that when i restart zimbra, only clamv is restarted, freshclam isn't.

I don't see any valid reason to have them joint, this is a very critical point of failure, mostly for unattended stop/start operations.

I have changed zmclamdctl to take in count of frashclam delay:
Code:
90-        >> ${zimbra_log_directory}/freshclam.log 2>&1 &
91:    echo "sleeping 300 secs"
92:    sleep 300
93-    echo -n "Starting clamd..."
and loop:
Code:
98:    for ((i = 0; i < 120; i++)); do
99-      checkrunning
but imho it would better to have another solution, not this ugly patch.

If all this makes sense, i could file an enhancement bug on bugzilla

-m
Reply With Quote
  #2 (permalink)  
Old 07-23-2009, 12:09 AM
Moderator
 
Posts: 7,928
Default

Yes please file a RFE.
__________________
Reply With Quote
  #3 (permalink)  
Old 08-13-2009, 11:55 PM
Elite Member
 
Posts: 296
Default

I have found another smarter solution.
Very simply, sequence should reverted.
Instead of starting freshclamav in daemon mode and then clamav:

Code:
   ${zimbra_home}/clamav/bin/freshclam \
      --config-file=${zimbra_home}/conf/freshclam.conf -d --checks=12 \
        >> ${zimbra_log_directory}/freshclam.log 2>&1 &

    echo -n "Starting clamd..."
    ${zimbra_home}/clamav/sbin/clamd \
      --config-file=${zimbra_home}/conf/clamd.conf \
        >> ${zimbra_log_directory}/clamd.log 2>&1 &
clamad should started before freshclam:

Code:
    echo -n "Starting clamd..."
    ${zimbra_home}/clamav/sbin/clamd \
      --config-file=${zimbra_home}/conf/clamd.conf \
        >> ${zimbra_log_directory}/clamd.log 2>&1 &

   ${zimbra_home}/clamav/bin/freshclam \
      --config-file=${zimbra_home}/conf/freshclam.conf -d --checks=12 \
        >> ${zimbra_log_directory}/freshclam.log 2>&1 &

this way clamd starts always with a consistent daily.cvd, then freshclam is started and, when it finish to refresh db, if daily.cvd was really refreshed, it will notify clamd to reload itself:

~/conf/freshclam.conf
Code:
# Send the RELOAD command to clamd.
# Default: no
NotifyClamd /opt/zimbra/conf/clamd.conf
i will file an RFE

Last edited by maumar; 08-13-2009 at 11:57 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.