Skip to content

Use exec in docker entrypoints to ensure bundler receives stop signals #934

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Almighty-Alpaca
Copy link

@Almighty-Alpaca Almighty-Alpaca commented Mar 9, 2025

Currently when stopping a Docker Compose stack using docker compose stop/down Docker simply waits 10 seconds (default timeout) and then kills the contains. This happens because Bash is running as PID 1 inside the container. Bash receives the stop signal, but doesn't forward it to Dawarich. When using exec to start Dawarich, Dawarich replaces the Bash process instead of being spawned as a child and therefore receives all signals directly. See krallin/tini#8 (comment) for a really good explanation on signals in Docker.

Additionally, I escaped all variables and removed useless assignments. Previously, unquoted variable usages could lead to unwanted shell expansion (although it shouldn't have been a problem before when using "sane" inputs for the variables).

@Almighty-Alpaca Almighty-Alpaca force-pushed the feature/docker-entrypoint-exec branch from eb81738 to 1ffd457 Compare March 9, 2025 20:35
@Almighty-Alpaca Almighty-Alpaca force-pushed the feature/docker-entrypoint-exec branch from 1ffd457 to ceb03c8 Compare May 19, 2025 18:52
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.

1 participant