Skip to content
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

Fix issue 517 (zombie processes in docker containers) #568

Closed
wants to merge 11 commits into from

Conversation

Dimokus88
Copy link
Contributor

Fixing issue 517 (zombie processes in docker containers)

@andy108369 found a way to fix zombie processes in docker containers by using tail -f /dev/null instead of sleep infinity which was used before.
I changed some of the executable scripts according to his recommendation.

@andy108369
Copy link
Collaborator

andy108369 commented Aug 23, 2024

Thank you for PR, @Dimokus88 !
Clarification: both "sleep infinity" & "tail -f /dev/null" would work. They are interchangeable.

The way it works is the added proccess manager - tini, which handles zombie processes now.
More info on how and why zombie proccesses occur, with the examples how tini manages them, is here #565 (comment)

@Dimokus88 before I merge, have you tested each of these deployments?

Copy link
Collaborator

@andy108369 andy108369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you've missed to add tini itself, i.e.

replace /usr/local/bin/init.sh to the relevant though

# 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.
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--", "/usr/local/bin/init.sh"]

CMD ["tail", "-f", "/dev/null"]

@Dimokus88
Copy link
Contributor Author

Thx @andy108369 I was sure that it is present in ubuntu by default.
I will double check and reopen the PR

@Dimokus88 Dimokus88 closed this Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants