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

[bug] container not following SIGTERM signals to close down (inc possible fixes) #21

Open
andrewcrook opened this issue Jul 27, 2023 · 0 comments

Comments

@andrewcrook
Copy link

andrewcrook commented Jul 27, 2023

Hello,

I keep getting the following error Docker container borg-server stopped unexpectedly around the time watchtower is scheduled. I have looked into and the only thing I think that has happened is that the container isnt responding to SIGTERM signals causing watchtower, after sometime, to force it via SIGKILL.

I read that this can be caused if the processes of the container are called under bash -c because the SIGTERM signals are not passed on to processes.

Apparently
ENTRYPOINT /run.sh
wraps /run.sh in bash -c

and

ENTRYPOINT [“/run.sh”]
doesn’t
as officially explained

You can also propagate SIGTERM signals to bash child processes using bash’s trap and wait

Lastly, not all docker containers or applications use SIGTERM here you can use dockerfile's STOPSIGNAL to change the signal type

I think its probably the first two issues.

@andrewcrook andrewcrook changed the title [bug] when using Watchtower Docker container borg-server stopped unexpectedly (inc possible fixes) [bug] container not following SIGTERM signals to close down (inc possible fixes) Jul 27, 2023
ZackEndboss added a commit to ZackEndboss/docker-borgserver that referenced this issue Jun 21, 2024
… close down

if the processes of the container are called under bash -c  because the SIGTERM signals are not passed on to processes.

Apparently
ENTRYPOINT /run.sh
wraps /run.sh in bash -c

and

ENTRYPOINT [“/run.sh”]
doesn’t

Thanks to @andrewcrook
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

1 participant