security/antivir-milter won't start correctly

Martin P. Hellwig mhellwig at xs4all.nl
Mon Feb 23 13:53:03 PST 2004


Hi all,

I've installed the port on my test machine (5 current), configured 
sendmail, did a "/usr/local/etc/rc.d/antivir-milter.sh start" and a 
"/etc/rc.d/sendmail restart" and guess what , it all works :-)
But because I always do extensive testing on my test machine, I reboot 
to see if things go up on there own again.
And this isn't the case, sendmail started, "/usr/local/sbin/avmilter" is 
running but no "/usr/local/AntiVir/avmilter.sock"
Wich causes sendmail to stop accepting e-mail delivering ("please retry 
later" message after "rcpt to:") the strange thing is that when I 
manually do a "/usr/local/etc/rc.d/antivir-milter.sh stop" and 
"/usr/local/etc/rc.d/antivir-milter.sh start" the avmilter.sock is created.
Doing a "/usr/local/etc/rc.d/antivir-milter.sh restart" results in a 
"can't initialize scan engine", I tested this command to see if restart 
works that way "/usr/local/etc/rc.d/antivir-milter.sh stop && 
/usr/local/etc/rc.d/antivir-milter.sh start" but it fails the same as 
"/usr/local/etc/rc.d/antivir-milter.sh restart" however 
"/usr/local/etc/rc.d/antivir-milter.sh stop && sleep 1 && 
/usr/local/etc/rc.d/antivir-milter.sh start" does the expected.
So I guess there something going wrong, I did a ugly script to test 
where it goes wrong.
I did this by modifying the original startup script at this:
"
start)
                        if [ -x /usr/local/sbin/avmilter ]; then
                                umask 0077
                        echo "AntiVir milter starting" 
                                rm -f /usr/local/AntiVir/avmilter.sock
                                /usr/local/AntiVir/start-avmilter.sh &
                                umask 0022
                        fi
and the file /usr/local/AntiVir/start-avmilter.sh is this:
"

#! /bin/sh
/usr/local/sbin/avmilter -C /usr/local/etc/avmilter.conf -p \
local:/usr/local/AntiVir/avmilter.sock \
&& echo "AntiVir-milter started" \
|| echo "problem while starting AntiVir-milter" \
|| test -S /usr/local/AntiVir/avmilter.sock && echo "Socket Created" \
|| echo "Failure, no socket created

I have absolutely no idea why it now starts correctly and creates a 
socket on boot time, I'm relativly new to unix and shell scripting and 
by closer examination of my script I'm even convinced that the test 
reports wouldn't work but since avmilter starts correctly now I can't 
verify it :-)
So would somebody with more expirience take a closer look at it please?

Martin P. Hellwig


More information about the freebsd-ports mailing list