Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37590638
en ru br
ALT Linux repos
S:8.18.0-alt0.Alpha2
5.0: 8.14.3-alt3
4.1: 8.14.4-alt0.M41.1
4.0: 8.14.4-alt0.M40.1
3.0: 8.13.4-alt3
+updates:8.13.8-alt1.M30.1

Group :: System/Servers
RPM: sendmail

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/bash

PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH

# Source function library.
. /etc/init.d/functions

# Source clamav-milter configuration.
SourceIfNotEmpty /etc/mail/milters_watchdog.conf

if [ "x$MILTERS_LIST" == "x" ]; then
logger -p mail.error -i -t $0 "MILTERS_LIST is not defined in /etc/mail/milter_watchdog.conf"
exit 99
fi

ERRORS=0

for SERVICE_NAME in $MILTERS_LIST; do

COUNT=`ps axm|grep $SERVICE_NAME|egrep -v "grep|_watchdog"|wc -l`

if [ $[ $COUNT < 3 ] == 1 ]; then
#echo "$SERVICENAME restarting..."
service $SERVICE_NAME restart
ERRORS=$(( $ERRORS +1 ))
logger -p mail.warning -i -t $0 "service $SERVICE_NAME was restarted"
fi

done

[ $ERRORS -eq 0 ] || logger -p mail.warning -i -t $0 "$ERRORS service(s) was restarted"

exit $ERRORS
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin