Date: Thu, 9 Aug 2007 14:42:18 GMT From: Alexander Shikoff <minotaur@crete.org.ua> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/115353: clamav-milter does not start up when clamd listens TCP socket Message-ID: <200708091442.l79EgIDk020588@www.freebsd.org> Resent-Message-ID: <200708091450.l79Eo1xp002284@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 115353 >Category: ports >Synopsis: clamav-milter does not start up when clamd listens TCP socket >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 09 14:50:00 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Alexander Shikoff >Release: RELENG_6 >Organization: >Environment: FreeBSD typhoon.task.com.ua 6.2-STABLE FreeBSD 6.2-STABLE #2: Thu Jul 19 13:39:09 EEST 2007 root@typhoon.task.com.ua:/usr/obj/usr/src/sys/TYPHOON i386 # clamd -V ClamAV 0.91.1/3906/Thu Aug 9 15:52:45 2007 >Description: If clamd configured to use only TCP socket then clamav-milter rc.d script does not start clamav-milter. -S test in rc.d-script fails because there is no clamd UNIX-socket. >How-To-Repeat: 1. Disable LocalSocket and enable "TCPSocket 3310" and "TCPAddr 127.0.0.1" in clamd.conf. 2. Add following lines to rc.conf: clamav_freshclam_enable="YES" clamav_clamd_enable=YES clamav_milter_enable="YES" clamav_milter_socktimeout=2 clamav_milter_socket="/var/run/clamav/milter.sock" clamav_milter_flags=" --dont-scan-on-error \ --force-scan \ --blacklist-time=60 \ --quiet \ --max-children=16 \ --timeout=30 \ --external \ --server=localhost" 3. Start clamd with "/usr/local/etc/rc.d/clamav-clamd start" command. 4. Try to start clamav-milter. You should get the following error: # /usr/local/etc/rc.d/clamav-milter start Waiting for clamd socket.. There is no clamd socket (/var/run/clamav/clamd)! >Fix: Apply attached patch to clamav-milter rc.d-script, set clamav_clamd_socket variable to empty string in rc.conf to disable checks of local clamd UNIX-socket. Patch attached with submission follows: --- clamav-milter.orig 2007-08-09 17:15:27.000000000 +0300 +++ clamav-milter 2007-08-09 17:23:11.000000000 +0300 @@ -37,21 +37,23 @@ rc_flags="--pidfile ${pidfile} ${flags:-$clamav_milter_flags} $clamav_milter_socket" if checkyesno clamav_clamd_enable; then - echo -n "Waiting for clamd socket.. " - i=${clamav_milter_socktimeout} - while [ $i -ne 0 ] - do - [ -S "$clamav_clamd_socket" ] && break - if [ `expr $i % 10` -eq 0 ]; then - echo -n "${i}.. " + if [ ! -z "$clamav_clamd_socket" ]; then + echo -n "Waiting for clamd socket.. " + i=${clamav_milter_socktimeout} + while [ $i -ne 0 ] + do + [ -S "$clamav_clamd_socket" ] && break + if [ `expr $i % 10` -eq 0 ]; then + echo -n "${i}.. " + fi + sleep 1 + i=$(($i-1)) + done + echo + if [ $i -eq 0 ]; then + echo "There is no clamd socket (${clamav_clamd_socket})!" + exit 1 fi - sleep 1 - i=$(($i-1)) - done - echo - if [ $i -eq 0 ]; then - echo "There is no clamd socket (${clamav_clamd_socket})!" - exit 1 fi fi } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708091442.l79EgIDk020588>