zombie processes

Julian Field mailscanner at ecs.soton.ac.uk
Sun Jun 20 12:00:46 IST 2004


At 03:33 20/06/2004, you wrote:
>On Thu, 17 Jun 2004 08:09 pm, Julian Field wrote:
> > At 08:05 17/06/2004, you wrote:
> > >Julian Field wrote:
> > >>At 18:42 15/06/2004, Marcel Karras wrote:
> > >>>2. Whenever I send a mail, there'll be a new zombie process and ps
> > >>> shows "[MailScanner <defunct>]". The mail will be scanned and
> > >>> delivered just perfect but you can certainly imagine what would
> > >>> happen if this server would work in a productive area rather than a
> > >>> testing one.
> > >>
> > >>And you should find it will destroy the zombie process itself pretty
> > >>quickly too.
> > >
> > >I've noticed this zombie process too on my Linux+exim gateways.  FreeBSD
> > >seems unaffected but all the BSD gateways run sendmail.
> > >
> > >I know what zombies are and why they occur, but "mailscanner <defunct>"
> > >is never being cleaned up.  So I did some digging that might help solve
> > >why.  The following applies to all my Debian (woody) systems running
> > >exim3, MailScanner 4.31.6 and McAfee.
> > >
> > >When MailScanner is started, it creates the parent and child instances
> > >as per the config.  When a message batch is scanned for the FIRST TIME
> > >by a child (each child) it spawns a zombie.  The first and subsequent
> > >batches are all scanned properly, but there are no more zombies[1], and
> > >the first zombie is never cleaned up.  After a while, I end up with one
> > >zombie from each child, until the child is killed due to old age.  When
> > >the child is killed, the zombie goes with it...until the new child reads
> > >its 1st batch then the zombie returns.
> >
> > Are you 100% sure that the PID of the zombie process you see stays the
> > same? I would expect 1 zombie per batch, but you should find the pid
> > changes as it processes more batches.
>
>Good point - I've haven't paid that much attention to the actual PID, just
>noticed the perpetual zombie.  So I kept an eye on it to see what happens
>and the sequence is always the same:
>
>1. Start mailscanner (running with 1 child for simplicity of debugging).
>2. Incoming mail picked up and processing begins
>3. Mail finished scanning zombie process, $PID, left.
>4. Another batch is picked up for processing
>5. Zombie ($PID) from #3 is killed
>6. Mail finished scanning & another zombie, this time $PID+10 is left.
>7. Loop #4-#6 until MailScanner is stopped.
>8. Stop MailScanner - zombie is cleaned up.
>
>Seems the zombies ARE being cleaned up, but only when another batch is
>scanned.  After the subsequent batch is finished, a new zombie is left
>which is always 10 PID's higher than the previous (I have a ligtly loaded
>box so there's very little running in the background).

I am fully aware that a zombie or two will appear to hang around, but will
in fact be continuously replaced by another one as they are cleaned up.
Doing it this way makes the code run faster, so I have no intention of
changing it. The zombies are totally harmless and are actually only very
short-lived, as you have seen. There is not 1 permanent zombie (which I
would consider to be a bug).
--
Julian Field
www.MailScanner.info
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654

-------------------------- MailScanner list ----------------------
To leave, send    leave mailscanner    to jiscmail at jiscmail.ac.uk
Before posting, please see the Most Asked Questions at
http://www.mailscanner.biz/maq/     and the archives at
http://www.jiscmail.ac.uk/lists/mailscanner.html



More information about the MailScanner mailing list