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

Termination signals aren't being forwarded #73

Open
sergejostir opened this issue Feb 15, 2021 · 2 comments
Open

Termination signals aren't being forwarded #73

sergejostir opened this issue Feb 15, 2021 · 2 comments

Comments

@sergejostir
Copy link

Panel Version: all
Daemon Version: all
Service: all
Docker Image: all
Modified: no

Errors that you are experiencing:
Entrypoint start the server process by using fork (so that the new process is spawned and the entrypoint stays PID 1). Shell doesn't forward termination signals by default, so all eggs that depend on SIGINT (or any other signal) to gracefully stop the container currently don't work as expected.

The server process should be started using "exec", so it replaces the current process and takes the PID 1. This way termination signals sent to the container will actually reach the server process which can then act accordingly.

@sergejostir sergejostir changed the title Termination signals aren't getting forwarded Termination signals aren't being forwarded Feb 15, 2021
@sergejostir
Copy link
Author

That commit makes it that you can specify the signal you want to send, but it won't fix anything because the signal will never propagate to the actual server process.

@matthewpi
Copy link

I can confirm this fix works. I changed all my images to use exec instead of eval and now a ^C signal properly works, for this testing I was using my go1.15 image with go run main.go as the startup command. Before the change from eval to exec, pressing stop would cause the app to be marked as stopping for around 10 seconds, then be was marked as offline; after the change, the app was marked as offline almost immediately after pressing the stop button.

iddqd0 added a commit to iddqd0/yolks that referenced this issue May 10, 2023
Change `eval` to `exec`

fix parkervcp/images#73
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