Re: [exim] Still got this error

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Odhiambo G. Washington
Datum:  
To: Ron McKeating
CC: Exim-Users \(E-mail\)
Betreff: Re: [exim] Still got this error
* Ron McKeating <R.J.Mckeating@???> [20050204 17:45]: wrote:
> Hi all,


Hi Ron ;)

> Apologies for cross posting this on the SA and exim list but there are
> many years of experienced linux email managers on the two lists.


You exempted non-Linux managers because you are going to deal with a
SysV-type init script, I guess.


> I am still frequently getting an error from our cron job. The cron entry
> is
>
> service spamd restart
>
> and the log entry is
>
> Feb 4 14:15:00 bill spamd: spamd shutdown succeeded
> Feb 4 14:15:01 bill spamd: Could not create INET socket on
> 127.0.0.1:783: Address already in use (IO::Socket::INET: Address already in use)
> Feb 4 14:15:01 bill spamd: spamd startup failed


This means that the 'restart" command is stopping/starting spamd so
rapidly it never waits for spamd to completely exit. Perhaps spamd
requires a few more seconds to kill all active children!

Can you add a few seconds 'sleep' in the script? From
what I guess (because you did not show the script), the script is
two-pronged - there is a 'stop' then a 'start' sequence within.

So, assuming the script is something like (hey, this is BSD-type):

#!/bin/sh
case "$1" in
    stop)
        killall -TERM spamd
        echo "spamd stopped"
        ;;
    restart)
        killall -TERM spamd
        /usr/local/bin/spamd $ARGS
        echo "spamd restarted"
        ;;
    -h)
        echo "Usage: `basename $0` { start | stop | restart }"
        ;;
    *)    # includes start
        /usr/local/bin/spamd $ARGS
        echo -n ' idled'
        ;;
esac



... try to modify the "restart" routine to be


restart)
    killall -TERM spamd
    sleep 5
    /usr/local/bin/spamd $ARGS
    echo "spamd restarted"
    ;;



> Then in the exim log I get
>
> 2005-02-04 14:39:01 1Cx4bt-0005qk-JY spam acl condition: warning - spamd
> connection to 127.0.0.1, port 783 failed: Connection refused
> 2005-02-04 14:39:01 1Cx4bt-0005qk-JY spam acl condition: all spamd
> servers failed



This means that spamd was actually "stopped", and exim child processes
could not connect to it.


> If I manually type service spamd restart all seems to be ok ,of course
> the shut down fails as it never started from the cron job so I get
>
> [root@bill exim]# service spamd restart
> Shutting down spamd:                                       [FAILED]
> Starting spamd:                                            [  OK  ]

>
> Any thoughts? we have two mail setups and this only occurs on one of
> them. (A dell 2650 ,the old dell 2550 running same version of everything
> does not get the problem).


This is interesting. Are you saying that the spamd control scripts are
identical on the two machines?? I would suggest you put some debug lines
in the troublesome script..

I believe that this is __not__ a problem within the cron, but with the
script itself, but since it's a shell script, it should be easy to
debug.

Shall we take a look at the scripts from both boxes?

        cheers
       - wash 
+----------------------------------+-----------------------------------------+
Odhiambo Washington                    . WANANCHI ONLINE LTD (Nairobi, KE)  |
wash _at_ wananchi _ dot _ com        . 1ere Etage, Loita Hse, Loita St.,  |
GSM: (+254) 722 743 223            . # 10286, 00100 NAIROBI             |
GSM: (+254) 733 744 121            . (+254) 020 313 985 - 9             |
+---------------------------------+------------------------------------------+
"Oh My God! They killed init! You Bastards!"  
                         --from a /. post