Start clamav and havp in the correct sequence



  • I've a problem that i don't understand how to resolve :\

    I've installed a pfsense 1.2.0 with squid and squidguard packages. Later i've installed clamav and havp packages from freebsd 6.3 packages. All works perfectly but i've a problem at startup! Pratically, havp tries to start before clamav so it can't found the socket and give an error!

    
    30/01/2009 10:40:46 === Starting HAVP Version: 0.86
    30/01/2009 10:40:46 === Mandatory locking disabled! KEEPBACK settings not used!
    30/01/2009 10:40:46 Change to user clamav
    30/01/2009 10:40:46 Change to group clamav
    30/01/2009 10:40:46 --- Initializing Clamd Socket Scanner
    30/01/2009 10:40:47 Clamd: Could not connect to scanner! Scanner down?
    30/01/2009 10:40:47 ERROR: Clamd Socket Scanner failed EICAR virus test! (Could not connect to scanner socket)
    
    

    I've modified clamav and havp startup scripts to create their directories into /var/run at startup

    
    havp_enable="YES"
    
    . /etc/rc.subr
    
    mkdir /var/run/havp > /dev/null 2>&1
    chown clamav:clamav /var/run/havp
    .
    .
    .
    
    

    and

    
    clamav_clamd_enable="YES"
    
    . /etc/rc.subr
    
    mkdir /var/run/clamav > /dev/null 2>&1
    chown clamav:clamav /var/run/clamav
    .
    .
    .
    
    

    I've tried to set into the HAVP package the REQUIRED fields to clamav, clamd, clamav-clamd and clamav_clamd but nothing to do, so i setted the BEFORE field into clamav-clamd startup script to havp, but here, too, nothing to do!

    Someone has a solution?

    thank you!



  • Temporanly i've resolved the problem with this little piece of bash code

    
    # check if havp must start
    if [ "$1" = "start" ];
    then
    
      # initialize a timer
      TIMER=20
    
      # loop timer got zero or until clamav socket is founded
      while [ $TIMER -gt 0 ] && [ ! -S /var/run/clamav/clamd ];
      do
    
        sleep 1
        let TIMER-=1 > /dev/null
    
      done
    
      # check if TIMER is equal to zero
      if [ ! -S /var/run/clamav/clamd  ];
      then
        echo "Clamav scanner socket missing!"
        exit 1
      fi
    fi
    
    

    before

    
    run_rc_command "$1"
    
    

    into /usr/local/etc/rc.d/havp.sh

    pratically … a simple timer that waits for 20 seconds before give a timeout, but it's not really realiable :\

    however ... better solutions are really appreciated



  • Look my HAVP gui:



  • @dvserg:

    Look my HAVP gui:

    I've tried to access it, but my proxy in the office blocks narod.ru

    (i use http://squidguard.mesd.k12.or.us/blacklists.tgz blacklists)


Locked