Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-09 Thread Michael Conrad
On 1/9/2018 1:53 PM, Laurent Bercot wrote: Zombies will _always_ be observable, even if you try to reap immediately.  Of course. I used "observable" in the broad sense, meaning there is a nonzero amount of time where init is not runnable, won't be scheduled, and won't immediately reap

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-09 Thread Laurent Bercot
Zombies will _always_ be observable, even if you try to reap immediately. Of course. I used "observable" in the broad sense, meaning there is a nonzero amount of time where init is not runnable, won't be scheduled, and won't immediately reap zombies. This makes zombie observation literally

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-09 Thread Denys Vlasenko
On Mon, Jan 8, 2018 at 7:53 PM, Laurent Bercot wrote: >> How about this: > > IIUC, this changes init's behaviour to only sleep after it has just > started a direct child, so as long as the /etc/inittab processes are > stable, it will always reap distant orphans

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-08 Thread Laurent Bercot
How about this: IIUC, this changes init's behaviour to only sleep after it has just started a direct child, so as long as the /etc/inittab processes are stable, it will always reap distant orphans instantly; but it will still wait for 1 second before reaping a batch of processes that died at

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-08 Thread Denys Vlasenko
On Sun, Jan 7, 2018 at 2:34 PM, Laurent Bercot wrote: >> It depends whether you consider init to be required to reap zombies >> as fast as possible. >> >> I don't see that as a requirement (so far, feel free to convince >> me otherwise). > > > I don't see it as a hard

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-07 Thread Laurent Bercot
It depends whether you consider init to be required to reap zombies as fast as possible. I don't see that as a requirement (so far, feel free to convince me otherwise). I don't see it as a hard requirement either; I don't really mind having zombies around for a few seconds, provided they

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-06 Thread Denys Vlasenko
On Thu, Jan 4, 2018 at 4:03 PM, Laurent Bercot wrote: >> Please point out the code in init.c which you think is buggy. > > > https://git.busybox.net/busybox/tree/init/init.c#n1216 is buggy. > > Unconditionally sleeping when signals may arrive is a no-no. If > a child

SV: Re: Re: [**EXTERNAL**] Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-05 Thread Markus Gothe
...@ciena.comKopia: busybox@busybox.netÄmne: Re: Re: [**EXTERNAL**] Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.this might be some quirke bug on Linux 3.10.108 or with uClibc, my zombies doesnt reparent to process 1 but to process 0

SV: Re: [**EXTERNAL**] Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-05 Thread Markus Gothe
@busybox.netÄmne: Re: [**EXTERNAL**] Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed. Hello, On Thu, Jan 4, 2018 at 6:53 PM, Cathey, Jim <jcat...@ciena.com> wrote:>Unconditionally sleeping when signals may arrive is a no-no. It used to be tha

Re: [**EXTERNAL**] Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Emmanuel Deloget
Hello, On Thu, Jan 4, 2018 at 6:53 PM, Cathey, Jim wrote: > >Unconditionally sleeping when signals may arrive is a no-no. > > It used to be that sleep(3) was interruptible. Is this no longer the > case? Who broke libc, and when? > * sleep() in musl is implemented using

Re: [**EXTERNAL**] SV: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Ralf Friedl
Cathey, Jim wrote: The rule is pretty simple: If you die, and your parent is still in the process list (regardless of its state), then you're a zombie until your parent reaps you. If you die and your parent is not in the process list, then init(8) reaps you at its earliest convenience. If

RE: [**EXTERNAL**] SV: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Cathey, Jim
The rule is pretty simple: If you die, and your parent is still in the process list (regardless of its state), then you're a zombie until your parent reaps you. If you die and your parent is not in the process list, then init(8) reaps you at its earliest convenience. If you're a zombie and

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Ralf Friedl
Markus Gothe wrote: Well, just to be sure we all talk about the same children that needs to be reaped are those of runsvdir, the bug manifests without using the inittab, surely init will reap the dead process of runsvdir but not the children themselves of runsvdir. To be sure we all talk

Re: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Emmanuel Deloget
Hello, On Thu, Jan 4, 2018 at 9:55 PM, Markus Gothe wrote: > Well, just to be sure we all talk about the same children that needs to be > reaped are those of runsvdir, the bug manifests without using the inittab, > surely init will reap the dead process of runsvdir but

SV: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Markus Gothe
  Ursprungligt meddelande   Från: ska-dietl...@skarnet.org Skickat: 4 januari 2018 16:04 Till: busybox@busybox.net Svara till: ska-dietl...@skarnet.org Ämne: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed. >Please point out the code in init.c which you think is bu

RE: [**EXTERNAL**] Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Cathey, Jim
>Unconditionally sleeping when signals may arrive is a no-no. It used to be that sleep(3) was interruptible. Is this no longer the case? Who broke libc, and when? -- Jim ___ busybox mailing list busybox@busybox.net

Re: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Denys Vlasenko
On Thu, Jan 4, 2018 at 10:14 AM, Markus Gothe wrote: > If you check init.c you will see that respawn is treated different from other > cases, and hence should be fixed in the program invoked. Please point out the code in init.c which you think is buggy.

SV: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-04 Thread Markus Gothe
till: ska-dietl...@skarnet.org Ämne: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed. >Without this fix it will create zombies that might cause deadlocks   No.   On December 23rd, when you sent a message to the list describing your issue, I sent a re

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-03 Thread Laurent Bercot
Without this fix it will create zombies that might cause deadlocks No. On December 23rd, when you sent a message to the list describing your issue, I sent a reply, the first reply you received, explaining what was happening to you. Did you read it? Did ANYONE read it? Or is the thought of

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-03 Thread Ralf Friedl
Markus Gothe wrote: Can you run strace on a process invoked from the inittab? I surely have issues with doing that. As far as killing the processes it doesnt matter which signal you use; processes will become zombified forever without the patch. Yes, I can run strace on a process invoked from

RE: [**EXTERNAL**] Re: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-03 Thread Cathey, Jim
so it reaps children and avoid zombi processes when killed. Hello, On Wed, Jan 3, 2018 at 11:04 PM, Markus Gothe <nietzs...@lysator.liu.se<mailto:nietzs...@lysator.liu.se>> wrote: Can you run strace on a process invoked from the inittab? I surely have issues with doing that. ​Thi

Re: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-03 Thread Emmanuel Deloget
Hello, On Wed, Jan 3, 2018 at 11:04 PM, Markus Gothe wrote: > Can you run strace on a process invoked from the inittab? I surely have > issues with doing that. > ​This is definitely possible, but thou shall not forget -ff to follow forks (and prepare for an awfull lot

SV: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-03 Thread Markus Gothe
Från: ralf.fri...@online.deSkickat: 3 januari 2018 22:43Till: nietzs...@lysator.liu.se; busybox@busybox.netÄmne: Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed. Markus Gothe wrote: Without this fix it will create zombies that might

Re: [PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-03 Thread Ralf Friedl
Markus Gothe wrote: Without this fix it will create zombies that might cause deadlocks, especially when respawned from the inittab and it dies because of a signal (e.g. ‘killall -9 runsvdir'). Installing a simple SIGCHLD-handler makes the problem go away. Signed-off-by: Markus Gothe

[PATCH] Fix runsvdir so it reaps children and avoid zombi processes when killed.

2018-01-03 Thread Markus Gothe
Without this fix it will create zombies that might cause deadlocks, especially when respawned from the inittab and it dies because of a signal (e.g. ‘killall -9 runsvdir'). Installing a simple SIGCHLD-handler makes the problem go away. Signed-off-by: Markus Gothe