-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bare ssh image doesn't handle child processes #565
Comments
Test resultsI've tested everything & explained in details below. Current state
As you can see PID 1 and Child Process ReapingPID 1 process is responsible for handling (reaping) orphaned child processes after their parent process close. The PID 1 process, also known as the init process, is responsible for reaping child processes that become orphaned when their parent process exits. This is a key role of PID 1 because if it doesn't reap these orphaned processes, they become zombie processes, which can eventually exhaust system resources From
From
More details:
What's "reaping"? How does it work?"reaping" in the context of process management refers to the action that a parent process takes to handle the termination of its child processes. When a child process exits, it sends a Key Points:
In essence, reaping ensures that resources are properly freed and that zombie processes don't accumulate. When you use Signal HandlingIt's important to note that a process running with PID 1 cannot be terminated using In this context, the Service managers such as When Kubernetes (via kubelet/containerd or Docker) stops a process, it sends a Docker typically waits for 10 seconds after sending To verify this you can test it:
EXTRA: built-in
|
…ling (akash-network#565) Use tini as an init system to manage orphaned child processes, ensuring they don't become zombie (defunct) processes by reaping (cleaning up) them when their parent process doesn't. Tini will also correctly handle signals like SIGTERM (15), allowing child processes to terminate gracefully within the allotted time, rather than being forcefully killed with SIGKILL after a 15-second timeout.
…ling (#565) (#566) Use tini as an init system to manage orphaned child processes, ensuring they don't become zombie (defunct) processes by reaping (cleaning up) them when their parent process doesn't. Tini will also correctly handle signals like SIGTERM (15), allowing child processes to terminate gracefully within the allotted time, rather than being forcefully killed with SIGKILL after a 15-second timeout.
Todo
Update:
|
bare ssh image doesn't handle child processes;
https://akash.network/docs/providers/provider-faq-and-guide/#kill-zombie-processes kills such container when they unintentionally spawn Z-ombie (defunct) processes.
We should
exec /usr/sbin/sshd -D
instead ofexec tail -f /dev/null
to fix it.Good ssh container example is here
Zombie process reproducer
Thanks Deval for the reprocuder
step 1
step 2
zombie process:
The text was updated successfully, but these errors were encountered: