> Anyone using inetd to launch spamd? I've had my process die a couple of
> times and it would be nice to have inetd around to make sure it's allways
> running. If you have, what did you put in inetd.conf?
>
> Thanks!
>

I use FreeBSD, so mine starts with my rc.d startup. You could always start
the daemon with /etc/rc.local I guess...

You want spamd to deamonize, not run per-instance. Inetd is a bad choice.

Run it as a daemon at startup, and then make a script like below which you
use crontab to run every 5-10 minutes to make sure spamd's still
running...

Here's mine, and it has some other stuff like how I log it, and my paths
which are going to be different than yours.

------- START SHELL SCRIPT ------------

#!/bin/sh
today=`date +"%b.%d.%Y"`
time=`date +"%H:%M.%S"`
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin/scripts


# CHECK FOR LOG FILE
if [ -f /var/log/monitor.log ] ; then
        fakeflag="pass"
   else
        touch /var/log/monitor.log
fi

#CHECK TO SEE IF SPAMD RECENTLY FAILED
count="0"
count=`cat /var/log/maillog | tail -50 | grep -c "to spamd at 127.0.0.1
failed"`

if test "$count" = "0"; then
        needrestart="no"
else
        needrestart="yes"
        echo "$today.$time  SPAMD : Down : RESTARTED" >> /var/log/monitor.log
        /usr/local/etc/rc.d/spamd.sh restart
fi
exit

Reply via email to