Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

loop reaping dead children #29

Merged
merged 1 commit into from
Jul 15, 2017

Conversation

c0b
Copy link
Contributor

@c0b c0b commented Jul 14, 2017

Current code isn't very correct: because Linux signal system design
follows SysV Unix behavior, when a SIGCHLD happens, it only means there
are child programs died (either self-quit or involuntarily killed, from
wstatus may figure out), linux kernel only deliver SIGCHLD once to parent
before the parent process;
so when SIGCHLD happens, you don't know is that one child only or more

so the code need a loop until wait4 returns zero, at rumtime got this:

2017/07/14 21:14:32 reap dead child: 579, wstatus: 0x00000000
2017/07/14 21:14:32 reap dead child: 580, wstatus: 0x00000000
2017/07/14 21:14:32 reap dead child: 583, wstatus: 0x00000000

then in the container there are no more zombies. final resolve #26

Current code isn't very correct: because Linux signal system design
follows SysV Unix behavior, when a SIGCHLD happens, it only means there
are child programs died (either self-quit or involuntarily killed, from
wstatus may figure out), linux kernel only deliver SIGCHLD once to parent
before the parent process;
so when SIGCHLD happens, you don't know is that one child only or more

so the code need a loop until wait4 returns zero, at rumtime got this:

```console
2017/07/14 21:14:32 reap dead child: 579, wstatus: 0x00000000
2017/07/14 21:14:32 reap dead child: 580, wstatus: 0x00000000
2017/07/14 21:14:32 reap dead child: 583, wstatus: 0x00000000
```

then in the container there are no more zombies. final resolve codeskyblue#26
@c0b
Copy link
Contributor Author

c0b commented Jul 14, 2017

your CI seems failed at openssl equinox lines?

$ openssl aes-256-cbc -K $encrypted_6219389dc5b7_key -iv $encrypted_6219389dc5b7_iv -in equinox.key.enc -out equinox.key -d
iv undefined
The command "openssl aes-256-cbc -K $encrypted_6219389dc5b7_key -iv $encrypted_6219389dc5b7_iv -in equinox.key.enc -out equinox.key -d" failed and exited with 1 during .
Your build has been stopped.

@codeskyblue codeskyblue merged commit ed9230e into codeskyblue:master Jul 15, 2017
codeskyblue added a commit that referenced this pull request Aug 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when used as system init; need to reclaim zombie processes
2 participants