[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Question regarding runsvdir not reaping children.
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2017-12-26 19:37:22
Message-ID: CAK1hOcO9ehT=+G_RhWHbfh_zrEyiTSKqso3yDGpJ6_4SkXeq=Q () mail ! gmail ! com
[Download RAW message or body]

On Tue, Dec 26, 2017 at 6:09 AM, Markus Gothe <nietzsche@lysator.liu.se> wrote:
> Yes, I saw that but for some reason if you kill it that code will never be invoked \
> and hence the children will become zombies.

I do see it happening.
Here I made one of runsv's to exit via "sv exit /var/service/something":

20:35:12.274316 nanosleep({tv_sec=5, tv_nsec=0}, {tv_sec=1,
tv_nsec=660388676}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
20:35:15.614150 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED,
si_pid=518, si_uid=0, si_status=0, si_utime=1, si_stime=2} ---
20:35:15.614199 restart_syscall(<... resuming interrupted nanosleep ...>) = 0
20:35:17.274544 wait4(-1, NULL, WNOHANG, NULL) = 518
20:35:17.274640 wait4(-1, NULL, WNOHANG, NULL) = 0


> On 25 Dec 2017, at 22:13 , Denys Vlasenko <vda.linux@googlemail.com> wrote:
> 
> > On Fri, Dec 22, 2017 at 9:48 PM, Markus Gothe <nietzsche@lysator.liu.se> wrote:
> > > What is the rationale behind not reaping the children when the program
> > > exists? i run it from inittab as a respawn process and I get zombies when
> > > killing it when not reaping children alas the fix was pretty simple.
> > 
> > runsvdir does read any children:
> > 
> > for (;;) {
> > unsigned now;
> > unsigned sig;
> > 
> > /* collect children */
> > for (;;) {
> > pid_t pid = wait_any_nohang(NULL);
> > if (pid <= 0)
> > break;
> > for (i = 0; i < svnum; i++) {
> > if (pid == sv[i].pid) {
> > /* runsv has died */
> > sv[i].pid = 0;
> > need_rescan = 1;
> > }
> > }
> > }
> 
> //Markus - The panama-hat hacker
> 
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic