Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] Crash of 4.0a [Was: Errors in sendmail with 4.0a1]

2007-05-27 by Joel Reicher

> Here is my /usr/local/etc/check_milter_greylist which is scheduled to run
> every five minutes from crontab on SuSE LINUX:
> 
> #! /bin/bash
> PIDLIST="$(ps axo ppid,pid,comm | awk '{ if ($1 == 1 && $3 == "milter-greylis
> t") print $2}')"
> if [[ x"$PIDLIST" == x ]]
> then
>   /etc/init.d/milter-greylist start > /dev/null 2>&1
>   recipient=postmaster
>   mailx -s "Milter-greylist restarted on $(hostname)" "$recipient" < /dev/nul
> l
> else
>  :
> #  printf 'RUNNING: %s\n' "$PIDLIST"
> fi

Why do something so complex? You could instead run milter-greylist in
the foreground inside an infinite loop, putting whatever else you like
in the loop for notification and other cleanup, e.g.

#!/bin/sh

while true; do
        ...some stuff...
        /usr/local/bin/milter-greylist -D
        ...some stuff...
done &

If an infinite loop makes you nervous, you can create some safety that
will exit the loop in the event of something like 5 relaunches in the
space of 5 seconds.

Better than periodically checking the process table, IMHO.

Cheers,

	- Joel

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.