http://www.perlmonks.org?node_id=909957

sundialsvc4 has asked for the wisdom of the Perl Monks concerning the following question:

I’m running some processes as Apache static-servers under mod_fastcgi (latest version), and I notice that, when I do apachectl stop, I am left with processes that are defunct.

Specifically, I am using Plack::Handler::FCGI with nprocs = 10, and upon termination of Apache it is the parent processes (and therefore, all of their children also) that are defunct.   (The parent-pid of the dead fish is now 1.   i.e. init)

It is not immediately obvious to me why this would be so.   Any suggestions?

  • Comment on "Defunct" FastCGI processes (mod_fastcgi) after apachectl stop

Replies are listed 'Best First'.
Re: "Defunct" FastCGI processes (mod_fastcgi) after apachectl stop
by flexvault (Monsignor) on Jun 17, 2011 at 15:55 UTC

    I've seen this problem, but not your specific case. If you kill -9 a process, the process is killed without getting control again. So the process can't reap its zombies. Some operating systems will clean up, and others won't.

    apachectl is a shell script that calls "httpd" with different parms. So if your "man httpd", and you could then try various ways to shut the apache server down using "httpd ...". If you find what you want, then either update apachectl or generate a script to do it correctly.

    Good Luck

    "Well done is better than well said." - Benjamin Franklin

Re: "Defunct" FastCGI processes (mod_fastcgi) after apachectl stop
by sundialsvc4 (Abbot) on Oct 01, 2011 at 12:12 UTC

    Well, I am still seeing zombies.   (And, were it not for their annoying propensity for playing the Thriller video at top volume all day and all night, I probably wouldn’t mind.   But the computer center operators are beginning to complain, and, well, I’ve always been a little suspicious of nighttime sysops, anyway...)

    When I drop in to visit now and then, I see one or more zombie process-trees.   (These consist of the now-zombie processes started as CgiStaticServers, and their also-zombie children.)   Meanwhile, another process-tree is running merrily away.   (The site is up, but there are just these dead bodies everywhere, playing Michael Jackson videos.)   I can always get rid of them by kill -9 on the parent-zombies, but why isn’t Apache/mod_fastcgi cleaning them up?

      but why isn’t Apache/mod_fastcgi cleaning them up?

      Shot in the dark, but mabye $SIG{PIPE}= $SIG{CHLD}= 'IGNORE';??

      I hope you post this in the bug cue

Re: "Defunct" FastCGI processes (mod_fastcgi) after apachectl stop
by Anonymous Monk on Feb 11, 2013 at 03:41 UTC
    any updates on this?