/etc/init.d/MailScanner stop: caught SIGTERM, aborting

Jarry mr.jarry at gmail.com
Wed May 27 17:22:42 IST 2009


Glenn Steen wrote:
> 2009/5/24 Jarry <mr.jarry at gmail.com>:
>> For whatever reason I can not stop/start MailScanner cleanly:
>>
>> # /etc/init.d/MailScanner stop
>> * Stopping MailScanner...
>> * MailScanner: caught SIGTERM, aborting
>>
>> # /etc/init.d/MailScanner start
>> * WARNING: MailScanner has already been started
>>
>> Actually, MailScanner stops, but sendmail which has been
>> started by MailScanner init script is still there running:
>>
>> # ps -e | grep sendmail
>> 18676 ?        00:00:00 sendmail
>> 18679 ?        00:00:00 sendmail
>>
>> Even when I killall sendmail, I still get the above mentioned
>> warning, and can not start MailScanner. And that is a problem,
>> because MailScanner is restarted (in my case, just want to be
>> restarted, but is not) every hour to prevent eating all resources
>> (which it keeps eating anyway, read next). I checked /var/run and
>> /var/lock, there is no trace of MailScanner or sendmail running,
>> yet I can not re-start Mailscanner.  How can I fix this problem?
> 
> What version of MailScanner, what version of what OS? It's rather like
> impossible to help you without those tidbits;-)

Sorry I did not mention it. I just thought it was not important.
MailScanner 4.70.7.1, OS Gentoo (stable branch, everything updated)

The /etc/init.d/MailScanner script looks this way:
----------------------------------
#!/sbin/runscript
opts="${opts} reload"
depend() {
        need net mta
        use logger dns }

start() {
        ebegin "Starting 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
        eend ${RETVAL}
}

stop() {
        ebegin "Stopping MailScanner"
        killall -15 MailScanner
        RETVAL=$?
        [ ${RETVAL} -eq 0 ] && rm -f /var/lock/subsys/MailScanner
        [ ${RETVAL} -eq 0 ] && touch /var/lock/subsys/MailScanner.off
        eend ${RETVAL}
}
# I removed "restart () {}" and "reload () {}" sections
----------------------------------

I'm not good at shell-programming, but this is what someone
on our mailing-list said about it (and others seemed to agree):

"...That's the ugliest init.d script ever. It looks like it fell
     out of the ugly tree, hit every branch on the way down and
     now not even its mother could love it..."

>> And the 2nd problem, MailScanner is eating too much memory:
>>
>> # ps aux | grep MailScanner
>> root  8047  0.0  0.7  93148 31084 ?  Ss   13:53   0:00 MailScanner: master
>> waiting for children, sleeping
>> root  8048  0.0  1.5 140136 64692 ?  S    13:53   0:00 MailScanner: waiting
>> for messages
>> root  8140  0.0  1.5 140136 64696 ?  S    13:54   0:00 MailScanner: waiting
>> for messages
>> root  8173  0.0  1.5 140136 64696 ?  S    13:54   0:00 MailScanner: waiting
>> for messages
>> root  8176  0.0  1.5 140140 64696 ?  S    13:54   0:00 MailScanner: waiting
>> for messages
>> root  8177  0.0  1.5 140140 64696 ?  S    13:54   0:00 MailScanner: waiting
>> for messages
>>
>> ~330 MB RESS, ~1GB VIRTS, is *this* normal? Unbelievable. I see it for
>> the first time, that my server does not have enough physical memory
>> and is forced to use swap. I'm affraid, I can not spend so much memory
>> just for MailScanner...
>>
> Are you perhaps using the clamavmodule?

No, I'm using F-Prot, and no SpamAssassin. My server has 2GB memory,
and out of it, running a few vservers. The one serving mail (strip-down
gentoo, with sendmail, f-prot and mailscanner) eats ~350MB physical
memory right after boot, out of that more than 300MB is mailscanner.
I could not believe it, when I saw it for the first time. 300 megs!!!

Jarry

-- 
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.


More information about the MailScanner mailing list