MailScanner 4.12-2 / 4.13-3 incoming failed

Magnus Stenman stone at HKUST.SE
Thu Mar 27 00:11:25 GMT 2003


I'm running 4 sendmail daemons, and I use the pid files to
tell the difference in the init script.
It gets the work done.

Maybe something for mailscanner?


init script attached


/magnus


Julian Field wrote:
>
> Really helps when vendors/distributors do nice things like that :-(
> Attached are new versions of
>          /etc/rc.d/init.d/MailScanner
>          /usr/sbin/check_mailscanner
>
> This now makes it impossible to make it work perfectly on all versions of
> RedHat Linux. It can now no longer tell the difference between the outgoing
> sendmail process in glibc 2.2 and the incoming sendmail process in glibc
> 2.3 as they both produce the same output. Also the incoming and outgoing
> sendmail processes in glibc 2.3 produce exactly the same ps output, making
> it impossible to differentiate between the 2.
>
...
>
>   ------------------------------------------------------------------------
>                   Name: MailScanner
>    MailScanner    Type: unspecified type (application/octet-stream)
>               Encoding: base64
>
>                         Name: check_mailscanner
>    check_mailscanner    Type: unspecified type (application/octet-stream)
>                     Encoding: base64
>
>   ------------------------------------------------------------------------
> --
> Julian Field
> www.MailScanner.info
> Professional Support Services at www.MailScanner.biz
> MailScanner thanks transtec Computers for their support
-------------- next part --------------
#!/bin/bash
#
# sendmail  sendmail daemons at max.hkust.se
#
# chkconfig: 2345 80 30
# description: sendmail daemons at max.hkust.se.
#              (mailscanner sendmail daemons + extra daemons for slow queue and list submissions)
# processname: sendmail
# config: /etc/sendmail.cf
# pidfile: /var/run/sendmail-in.pid
# pidfile: /var/run/sendmail-out.pid
# pidfile: /var/run/sendmail-slow.pid
# pidfile: /var/run/sendmail-list.pid

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

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

# Source config.
if [ -f /etc/sysconfig/sendmail-special ] ; then
        . /etc/sysconfig/sendmail-special
else
        QUEUETIME=5m
        INQDIR=/var/spool/mqueue.in
        SLOWQTIME=2h
        SLOWQDIR='/var/spool/mqueue/out-*'
        LISTQDIR=/var/spool/mqueue.out
        LIST_MTA_PORT=24
fi

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

[ -f /usr/sbin/sendmail ] || exit 0

RETVAL=0


# sendmail starters
start_in() {
    echo -n $"Starting sendmail-in: "
    daemon /usr/sbin/sendmail -bd -OPrivacyOptions=noetrn \
                              -ODeliveryMode=queueonly \
                              -OQueueDirectory=$INQDIR \
                              -ODaemonPortOptions=Name=inMTA \
                              -OPidFile=/var/run/sendmail-in.pid
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail-in
    return $RETVAL
}
start_out() {
    echo -n $"Starting sendmail-out: "
    daemon /usr/sbin/sendmail $([ -n "$QUEUETIME" ] && echo -q$QUEUETIME) \
                              -ODaemonPortOptions=Name=outMTA \
                              -OPidFile=/var/run/sendmail-out.pid
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail-out
    return $RETVAL
}
start_slow() {
    echo -n $"Starting sendmail-slow: "
    daemon /usr/sbin/sendmail -q1h -OQueueDirectory=$SLOWQDIR \
                              -ODaemonPortOptions=Name=slowMTA \
                              -OPidFile=/var/run/sendmail-slow.pid
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail-slow
    return $RETVAL
}
start_list() {
    echo -n $"Starting sendmail-list: "
    daemon /usr/sbin/sendmail -bd -ODeliveryMode=defer \
                              -ODaemonPortOptions=Name=listMTA,Port=24,M=E,Addr=localhost \
                              -OPidFile=/var/run/sendmail-list.pid
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail-list
    return $RETVAL
}


# sendmail stoppers
stop_in() {
        echo -n $"Shutting down sendmail-in: "
        kill `head -1 /var/run/sendmail-in.pid`
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail-in
        [ $RETVAL -eq 0 ] && rm -f /var/run/sendmail-in.pid
        return $RETVAL
}
stop_out() {
        echo -n $"Shutting down sendmail-out: "
        kill `head -1 /var/run/sendmail-out.pid`
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail-out
        [ $RETVAL -eq 0 ] && rm -f /var/run/sendmail-out.pid
        return $RETVAL
}
stop_slow() {
        echo -n $"Shutting down sendmail-slow: "
        kill `head -1 /var/run/sendmail-slow.pid`
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail-slow
        [ $RETVAL -eq 0 ] && rm -f /var/run/sendmail-slow.pid
        return $RETVAL
}
stop_list() {
        echo -n $"Shutting down sendmail-list: "
        kill `head -1 /var/run/sendmail-list.pid`
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail-list
        [ $RETVAL -eq 0 ] && rm -f /var/run/sendmail-list.pid
        return $RETVAL
}


# See how we were called.
case "$1" in
  start)
        start_in
        start_out
        start_slow
        start_list
        ;;
  stop)
        stop_in
        stop_out
        stop_slow
        stop_list
        ;;
  restart|reload)
        stop_in
        stop_out
        stop_slow
        stop_list
        start_in
        start_out
        start_slow
        start_list
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $RETVAL



More information about the MailScanner mailing list