PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : MailScanner + defunct



DaQuark
20.04.04, 10:08
Hallo Leute,

ich habe ein Red Hat 9 System mit MailScanner drauf. Wenn ich den Rechner anschalte und mich einlogge, startet der MailScanner anscheinend. Nur wenn ich ps -ax mache, dann steht 5 x [MailScanner <defunct>] und einmal normal [MailScanner].

a) ist das normal, dass so viele Prozesse von MailScanner offen sind ?
b) was bedeutet das defunct dahinter ?

Danke schonmal !

mfg Marcel

DaQuark
20.04.04, 11:34
Hier mal mein Start/Stop- Script aus /etc/rc.d/rc3.d/S99MailScanner





#!/bin/bash
#
# mailscanner This shell script takes care of starting and stopping
# MailScanner, and its associated copies of sendmail.
#
# chkconfig: 2345 80 30
# description: MailScanner is an open-source E-Mail Gateway Virus Scanner.
# processname: MailScanner
# config: /etc/MailScanner/MailScanner.conf
# pidfile: /var/run/MailScanner.pid

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

# Source networking configuration.
. /etc/sysconfig/network

#
# If you are using sendmail, Exim or Postfix, please try to avoid editing
# thie file. Edit /etc/sysconfig/MailScanner instead.
#
MTA=sendmail
QUEUETIME=15m
WORKDIR=/var/spool/MailScanner/incoming
INQDIR=/var/spool/mqueue.in
INPID=/var/run/sendmail.in.pid
OUTPID=/var/run/sendmail.out.pid
SMPID=/var/run/sm-client.pid
MSPUSER=smmsp
MSPGROUP=smmsp
SENDMAIL=/usr/sbin/sendmail
POSTFIX=/usr/sbin/postfix
POSTFIXINCF=/etc/postfix.in
POSTFIXOUTCF=/etc/postfix
EXIM=/usr/sbin/exim
EXIMINCF=/etc/exim.conf
EXIMSENDCF=/etc/exim_send.conf
ZMAILER=/usr/lib/zmailer/zmailer
ZMAILERCF=/etc/zmailer/zmailer.conf
RESTART_DELAY=10

# Source mailscanner configuration.
if [ -f /etc/sysconfig/MailScanner ] ; then
. /etc/sysconfig/MailScanner
fi
export MTA
export QUEUETIME
export WORKDIR
export INQDIR
export INPID
export OUTPID
export SMPID
export MSPUSER
export MSPGROUP
export SENDMAIL
export POSTFIX
export POSTFIXINCF
export POSTFIXOUTCF
export EXIM
export EXIMINCF
export EXIMSENDCF
export ZMAILER
export ZMAILERCF
export RESTART_DELAY

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/check_MailScanner ] || exit 0
[ -f $SENDMAIL ] || exit 0


if [ $MTA = 'zmailer' ]; then
# Source zmailer configuration.
if [ -f $ZMAILERCF ]; then
. $ZMAILERCF
else
echo "Missing ZMailer configuration file: $ZMAILERCF"
exit 1
fi
if [ ! -f $MAILBIN/zmailer ]; then
echo "Missing main ZMailer script: $MAILBIN/zmailer"
fi
if [ -z $POSTOFFICEIN ]; then
echo "Incoming postoffice not defined in $ZMAILERCF - patch zmailer configuration"
exit 1
fi
fi

# Start both the sendmail processes
StartInSendmail() {
if [ $MTA = 'postfix' ]; then
if test -x $POSTFIX -a -f $POSTFIXINCF/main.cf ; then
$POSTFIX -c $POSTFIXINCF start 2> /dev/null
success
echo
else
failure
echo
echo "Could not find Postfix installation, see /etc/sysconfig/MailScanner"
fi
elif [ $MTA = 'exim' ]; then
if test -x $EXIM ; then
$EXIM -C $EXIMINCF -bd 2> /dev/null
success
echo
else
failure
echo
echo "Could not find Exim installation, see /etc/sysconfig/MailScanner"
fi
elif [ $MTA = 'sendmail' ]; then
/usr/bin/newaliases > /dev/null 2>&1
if test -x /usr/bin/make -a -f /etc/mail/Makefile ; then
make -C /etc/mail -s
else
for i in virtusertable access domaintable mailertable ; do
if [ -f /etc/mail/$i ] ; then
makemap hash /etc/mail/$i < /etc/mail/$i
fi
done
fi
$SENDMAIL -bd -OPrivacyOptions=noetrn \
-ODeliveryMode=queueonly \
-OQueueDirectory=$INQDIR \
-OPidFile=$INPID
touch /var/run/sm-client.pid
chown $MSPUSER:$MSPGROUP /var/run/sm-client.pid 2>/dev/null
$SENDMAIL -L sm-msp-queue -Ac -q15m -OPidFile=$SMPID 2>/dev/null
success
echo
elif [ $MTA = 'zmailer' ]; then
$MAILBIN/zmailer smtpserver >/tmp/zmailer_start_output.$$ 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
success
echo
else
failure
echo
cat /tmp/zmailer_start_output.$$
fi
rm -f /tmp/zmailer_start_output.$$
else
failure
echo
echo "Invalid MTA in /etc/sysconfig/MailScanner"
fi
}
StartOutSendmail() {
if [ $MTA = 'postfix' ]; then
if test -x $POSTFIX -a -f $POSTFIXOUTCF/main.cf ; then
$POSTFIX -c $POSTFIXOUTCF start 2> /dev/null
success
echo
else
failure
echo
echo "Could not find Postfix installation, see /etc/sysconfig/MailScanner"
fi
elif [ $MTA = 'exim' ]; then
if test -x $EXIM ; then
$EXIM -C $EXIMSENDCF -q15m 2> /dev/null
success
echo
else
failure
echo
echo "Could not find Exim installation, see /etc/sysconfig/MailScanner"
fi
elif [ $MTA = 'sendmail' ]; then
$SENDMAIL $([ -n "$QUEUETIME" ] && echo -q$QUEUETIME) \
-OPidFile=$OUTPID
success
echo
elif [ $MTA = 'zmailer' ]; then
$MAILBIN/zmailer router scheduler >/tmp/zmailer_start_output.$$ 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
success
echo
else
failure
echo
cat /tmp/zmailer_start_output.$$
fi
rm -f /tmp/zmailer_start_output.$$
else
failure
echo
echo "Invalid MTA in /etc/sysconfig/MailScanner"
fi
}

RETVAL=0

# See how we were called.
case "$1" in
startin)
# Start just incoming sendmail
echo "Starting incoming $MTA only:"
echo -n ' incoming' $MTA': '
StartInSendmail
;;
startout)
# Start just outgoing sendmail
echo "Starting outgoing $MTA only:"
echo -n ' outgoing' $MTA': '
StartOutSendmail
;;
'start')
echo 'Starting MailScanner daemons:'
echo -n ' incoming' $MTA': '
StartInSendmail
echo -n ' outgoing' $MTA': '
StartOutSendmail
echo -n ' MailScanner: '
/usr/sbin/check_MailScanner >/dev/null
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/MailScanner
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/MailScanner.off
success
echo
touch /var/lock/subsys/MailScanner
;;
'stop')
echo 'Shutting down MailScanner daemons:'
echo -n ' MailScanner: '
killproc MailScanner -15
echo
echo -n ' incoming' $MTA': '
if [ $MTA = "postfix" ]; then
$POSTFIX -c $POSTFIXINCF stop 2>/dev/null
success
elif [ $MTA = "exim" ]; then
killproc exim 2>/dev/null
success
elif [ $MTA = "sendmail" ]; then
#killproc sendmail 2>/dev/null
kill `head -1 $INPID` 2>/dev/null
kill `head -1 /var/run/sm-client.pid` 2>/dev/null
success
elif [ $MTA = "zmailer" ]; then
$MAILBIN/zmailer stop smtpserver >/tmp/zmailer_stop_output.$$ 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
success
else
failure
echo
cat /tmp/zmailer_stop_output.$$
fi
rm -f /tmp/zmailer_stop_output.$$
else
failure
echo
echo "Invalid MTA in /etc/sysconfig/MailScanner"
fi
echo
echo -n ' outgoing' $MTA': '
if [ $MTA = "postfix" ]; then
$POSTFIX -c $POSTFIXOUTCF stop 2>/dev/null
success
elif [ $MTA = "exim" ]; then
success
elif [ $MTA = "sendmail" ]; then
#killproc /usr/sbin/sendmail 2>/dev/null
kill `head -1 $OUTPID` 2>/dev/null
success
elif [ $MTA = "zmailer" ]; then
$MAILBIN/zmailer stop router scheduler >/tmp/zmailer_stop_output.$$ 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
success
else
failure
echo
cat /tmp/zmailer_stop_output.$$
fi
rm -f /tmp/zmailer_stop_output.$$
else
failure
echo
echo "Invalid MTA in /etc/sysconfig/MailScanner"
fi
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/MailScanner
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/MailScanner.off
# Clear out all the old pid files
rm -f /var/run/MailScanner.pid
# Clear out the old incoming dirs
cd $WORKDIR && ls | egrep '^[0123456789]+$' | xargs /bin/rm -rf 2>/dev/null
rm -f /var/lock/subsys/MailScanner
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0

oafish
20.04.04, 14:33
Hi,
Mailscanner bringt sein eigenes Logbuch mit. Einfach mal reinschauen was ihm nicht passt. Normal ist nur ein Prozess mit einem defunc. Musst irgendwo in der Mailscanner.conf einen Bock drin haben. Am besten Schritt für Schritt durchackern...

oafish