> 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,
- JoelMessage
Re: [milter-greylist] Crash of 4.0a [Was: Errors in sendmail with 4.0a1]
2007-05-27 by Joel Reicher
Attachments
- No local attachments were found for this message.