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

Dockerfile: ensure json-server terminates on SIGTERM #144

Merged

Conversation

giorio94
Copy link
Member

Ensure that the json-server process terminates upon reception of the SIGTERM signal, so that the pod doesn't remain in terminating status for 30 seconds (the default grace period) when deleted. This fix involves two changes:

  • Run exec at the end of the run.sh script, instead of shelling out, so that the callee gets PID 1;
  • Wrap the json-server executable with the "tini" lightweight init system, as apparently node doesn't terminate upon SIGTERM when running as PID 1.

Ensure that the json-server process terminates upon reception of the
SIGTERM signal, so that the pod doesn't remain in terminating status
for 30 seconds (the default grace period) when deleted. This fix
involves two changes:

* Run exec at the end of the run.sh script, instead of shelling out,
  so that the callee gets PID 1;
* Wrap the json-server executable with the "tini" lightweight init
  system, as apparently node doesn't terminate upon SIGTERM when
  running as PID 1.

Signed-off-by: Marco Iorio <[email protected]>
@dylandreimerink dylandreimerink merged commit 93b6602 into cilium:master Jan 9, 2024
2 checks passed
@giorio94 giorio94 deleted the pr/giorio94/terminate-on-sigterm branch January 9, 2024 09:58
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.

3 participants