That is not the test case. The testcase is this: 'killall runsvdir'. Skickad via BlackBerry Hub för Android
Ursprungligt meddelande Från: [email protected] Skickat: 26 december 2017 20:37 Till: [email protected] Kopia: [email protected] Ämne: Re: Question regarding runsvdir not reaping children. On Tue, Dec 26, 2017 at 6:09 AM, Markus Gothe <[email protected]> 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 <[email protected]> wrote: > >> On Fri, Dec 22, 2017 at 9:48 PM, Markus Gothe <[email protected]> >> 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 [email protected] http://lists.busybox.net/mailman/listinfo/busybox
