-
Notifications
You must be signed in to change notification settings - Fork 204
Open
Labels
Description
Problem
Currently, dstackai/dstack image starts dstack server as a child of entrypoint, which is written in Bash, meaning that PID 1 is the Bash process.
The problem is that Bash doesn't forward signals to its children, making graceful shutdown of dstack server not possible (the container runtime usually sends SIGTERM, which does not reach the server, waits for some time – for Docker, it's 10 seconds by default, and then sends SIGKILL).
But when dstack server is started as PID 1, another problem appears – zombie processes, see this issue and this temporary fix for the details.
Solution
Add an init process to the image. It should:
- Reap orphan processes
- Forward signals to its child (
dstackserver)
tini is a good candidate.
Workaround
No response
Would you like to help us implement this feature by sending a PR?
Yes