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

Manually set signal handlers for SIGTERM and SIGINT if running as PID 1 (in container) #20

Closed
mini-bomba opened this issue Aug 17, 2024 · 1 comment

Comments

@mini-bomba
Copy link
Contributor

When a program is running as PID 1, its default SIGTERM and SIGINT handlers ignore the signal completely, instead of exiting.
As the program is running as PID 1 in the container, and does not set its own handlers for these signals, it ignores them, which makes it unnecessarily take longer to stop the container, as podman/docker waits some time after sending SIGTERM before resorting to SIGKILL.

The program should set its own handlers for SIGTERM and SIGINT, which do the necessary cleanup (if necessary) and exit.

@techmetx11
Copy link
Collaborator

Maybe it's better to just use Docker's builtin tiny init program

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

No branches or pull requests

2 participants