supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Gerrit Pape <pape@smarden.org>
To: supervision@list.skarnet.org
Subject: Re: runit not collecting zombies
Date: Sun, 3 Jun 2007 11:10:56 +0000	[thread overview]
Message-ID: <20070603111056.15978.qmail@3deb4a0e5d8414.315fe32.mid.smarden.org> (raw)
In-Reply-To: <20070526103517.GD24895@home.power>

[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]

On Sat, May 26, 2007 at 01:35:17PM +0300, Alex Efros wrote:
> On Fri, May 25, 2007 at 01:07:42AM +0200, Radek Podgorny wrote:
> > I'm experiancing a weird behaviour where runit (1.5.0) does not collect 
> > zombies. AFAIK the init (pid=1) process should take care of these and 
> > make them quit "correctly". I know that when zombies show up, the 
> > initiating application is to blame but in the real world, I need a 
> > stable server where I don't run out of PIDs after just few hours :-(.
> 
> I've just got same issue. This is first time I see runit does not collect
> zombies. Server uptime is 28 days, runit 1.5.0 (upgraded from 1.4.1 at
> 21 Apr). Server generate huge amount of short-living processes, so maybe
> some integer overflow in runit or something similar result in this issue.
> 
> Right now I've 8114 zombies and user which run all these scripts now
> unable to start new processes:
>     bash: fork: Resource temporarily unavailable
> 
> Looks like I've to reboot to fix this issue for some time. :-(

Hi Alex, the runit program didn't change from 1.4.1 to 1.5.0 or 1.5.1,
so downgrading should not help.  I'm not yet completely sure what the
actual problem is, but have an idea.  Can you please test the patch
below?:

 cd /package/admin/runit
 patch -p0 </the/attached/diff
 package/install
 ln /sbin/runit /sbin/runit.old
 install -m0755 command/runit /sbin/runit
 reboot

Thanks, Gerrit.

[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 628 bytes --]

Index: src/runit.c
===================================================================
RCS file: /cvs/runit/src/runit.c,v
retrieving revision 1.14
diff -u -r1.14 runit.c
--- src/runit.c	21 Nov 2006 15:09:18 -0000	1.14
+++ src/runit.c	3 Jun 2007 10:59:19 -0000
@@ -157,8 +157,9 @@
       sig_block(sig_child);
       sig_block(sig_int);
       
-      read(selfpipe[0], &ch, 1);
-      child =wait_nohang(&wstat);
+      while (read(selfpipe[0], &ch, 1) == 1) {}
+      while ((child =wait_nohang(&wstat)) > 0)
+        if (child == pid) break;
 
       /* reget stderr */
       if ((ttyfd =open_write("/dev/console")) != -1) {

  parent reply	other threads:[~2007-06-03 11:10 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24 23:07 Radek Podgorny
2007-05-26 10:35 ` Alex Efros
2007-05-26 10:45   ` Alex Efros
2007-05-26 12:55   ` Charlie Brady
2007-05-26 13:03     ` Alex Efros
2007-05-26 17:01   ` Paul Jarc
2007-06-02 14:55     ` Alex Efros
2007-06-03 11:10   ` Gerrit Pape [this message]
2007-06-03 14:33     ` Alex Efros
2007-06-03 16:31       ` Gerrit Pape
2007-06-11 13:11     ` Alex Efros
2007-06-18 13:45       ` Alex Efros
2007-06-19 18:13         ` Gerrit Pape
2007-06-19 19:07           ` Alex Efros
2007-06-20 16:23             ` Gerrit Pape
2007-06-20 16:57               ` Alex Efros
2007-06-20 18:35                 ` Gerrit Pape
2007-06-23  4:42                   ` Alex Efros
2007-06-26  9:59                     ` Gerrit Pape
2007-07-07  7:16                       ` Alex Efros
2007-07-07 18:13                         ` Charlie Brady
2007-07-07 19:12                           ` Alex Efros
2007-07-12 14:21                             ` Charlie Brady
2007-07-12 14:41                               ` Alex Efros
2007-07-12 14:45                                 ` Charlie Brady
2007-07-12 14:57                                   ` Alex Efros
2007-07-12 14:42                           ` Charlie Brady
2007-07-12 14:43                             ` Charlie Brady
2007-07-12 14:49                             ` Alex Efros
2007-07-12 15:11                               ` Charlie Brady
2007-07-12 15:15                                 ` Alex Efros
2007-07-12 15:40                                   ` Charlie Brady
2007-07-15 14:47                       ` Alex Efros
2007-07-15 19:07                         ` Alex Efros
2007-07-15 20:18                           ` George Georgalis
2007-07-15 20:31                             ` Paul Jarc
2007-07-15 22:35                               ` George Georgalis
2007-07-15 23:06                                 ` Paul Jarc
2007-07-15 23:23                                   ` Charlie Brady
2007-07-16  0:09                                     ` Alex Efros
2007-07-16  2:11                                       ` Charlie Brady
2007-09-12 12:53                                         ` Radek Podgorny
     [not found]                                         ` <47939.::ffff:77.75.72.5.1189601606.squirrel@mail.podgorny.cz>
2007-09-12 13:55                                           ` Charlie Brady
2007-09-12 14:35                                             ` Alex Efros
2007-09-12 14:55                                               ` Charlie Brady
2007-09-12 15:00                                                 ` Alex Efros
2007-09-12 16:02                                                   ` Charlie Brady
2007-09-12 16:10                                                     ` Radek Podgorny
2007-09-12 17:22                                                     ` Alex Efros
2007-09-12 17:40                                                       ` Charlie Brady
2007-09-12 18:18                                                         ` Alex Efros
2007-09-12 19:07                                                           ` Charlie Brady
2007-09-12 19:13                                                             ` Alex Efros
2007-09-12 19:18                                                               ` Charlie Brady
2007-09-12 19:30                                                                 ` Alex Efros
2007-09-12 19:37                                                                   ` Charlie Brady
2007-09-15 13:36                                                                 ` Alex Efros
2007-09-15 13:57                                                                   ` Alex Efros
2007-09-15 15:20                                                                     ` Charlie Brady
2007-09-15 15:28                                                                       ` Alex Efros
2007-09-15 15:47                                                                         ` Charlie Brady
2007-09-15 16:02                                                                           ` Alex Efros
2007-09-15 15:49                                                                         ` Charlie Brady
2007-09-15 15:55                                                                           ` Alex Efros
2007-09-15 16:02                                                                             ` Charlie Brady
2007-09-15 15:36                                                                       ` Alex Efros
2007-09-15 15:58                                                                         ` Charlie Brady
2007-09-15 14:03                                                                   ` Alex Efros
2007-09-17  7:56                                                                   ` Gerrit Pape
2007-09-17  9:07                                                                     ` Radek Podgorny
2007-09-17 11:59                                                                     ` Alex Efros
2007-09-18  8:14                                                                       ` Gerrit Pape
2007-09-18 11:33                                                                         ` Alex Efros
2007-09-18 11:45                                                                         ` Laurent Bercot
2011-02-15 13:12                                                                         ` [LONG] " Laurent Bercot
2011-02-15 15:00                                                                           ` Alex Efros
2011-02-15 15:22                                                                             ` Laurent Bercot
2007-09-12 16:04                                                   ` Radek Podgorny
     [not found]                                                   ` <35517.::ffff:77.75.72.5.1189613042.squirrel@mail.podgorny.cz>
2007-09-12 17:04                                                     ` Alex Efros
2007-09-12 19:38                                                       ` Mike Buland
2007-09-12 20:28                                                         ` Alex Efros
2007-09-12 20:38                                                           ` Alex Efros
2007-09-13  1:05                                                           ` Mike Buland
2007-09-13  8:58                                                       ` Radek Podgorny
     [not found]                                                       ` <50411.::ffff:77.75.72.5.1189673890.squirrel@mail.podgorny.cz>
2007-09-13 10:57                                                         ` Alex Efros
2007-09-13 12:06                                                           ` Alex Efros
2007-09-13 14:31                                                           ` Radek Podgorny
     [not found]                                                           ` <51910.::ffff:77.75.72.5.1189693860.squirrel@mail.podgorny.cz>
2007-09-13 14:51                                                             ` Alex Efros
2007-07-16  2:24                                   ` George Georgalis
2007-07-01  8:43                   ` Radek Podgorny
2007-07-02  8:28                     ` Gerrit Pape
2007-07-02 11:23                       ` Radek Podgorny
2007-07-02 12:14                         ` Gerrit Pape
2007-07-02 12:42                           ` Radek Podgorny
2007-07-07  4:54                       ` Alex Efros
2007-06-20 19:57                 ` Charlie Brady
2008-02-25  7:25 ` Alex Efros
2008-02-25 14:57   ` Charlie Brady
2008-02-25 15:23     ` Radek Podgorny
     [not found]     ` <59012.::ffff:77.75.72.226.1203952988.squirrel@mail.podgorny.cz>
2008-02-25 15:26       ` George Georgalis
2008-02-25 15:32       ` Charlie Brady
2008-02-25 16:17         ` Alex Efros
2008-02-25 17:20       ` Mike Buland
2008-02-25 15:27   ` Radek Podgorny
     [not found]   ` <34616.::ffff:77.75.72.226.1203953244.squirrel@mail.podgorny.cz>
2008-02-25 16:15     ` Alex Efros
2008-02-27  8:19   ` Bernhard Graf
2008-02-27  8:36     ` Alex Efros
2008-02-27  8:58       ` Bernhard Graf
     [not found] ` <F694D808C0BB4890A12C565F68B9A691@home.internal>
2008-02-25 16:24   ` rehan khan
2008-02-25 16:27     ` Charlie Brady
     [not found]     ` <54B6D6D6D32D4DB685F8CA9A836076D7@home.internal>
2008-02-25 17:11       ` rehan khan
2008-02-25 19:13     ` Charlie Brady
2008-10-21 21:46 ` Alex Efros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070603111056.15978.qmail@3deb4a0e5d8414.315fe32.mid.smarden.org \
    --to=pape@smarden.org \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).