-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Kibana version:
Tested with latest 7.15.0 and 8.0.0-alpha2
Original install method (e.g. download page, yum, from source, etc.):
Using the official docker.elastic.co/kibana/kibana image
Describe the bug:
The container does not respond to SIGTERM, making it impossible to gracefully shutdown Kibana.
Steps to reproduce:
- Execute
docker run --rm docker.elastic.co/kibana/kibana:7.15.0 - Try to press
CTRL+C - Nothing happens
Expected behavior:
The container should respond to the TERM signal and gracefully shutdown
Identified cause:
There are three running processes in the conainer:
bash-4.4$ ps -e --forest
PID TTY TIME CMD
1 ? 00:00:00 tini
7 ? 00:00:00 node
952 ? 00:01:04 \_ node
The main "node" process (PID 7) does not respond to SIGTERM (I am not a node specialist, I can't really explain why), only the child node process (952) does. When a SIGTERM is sent to the container, PID1 (tini) forwards it to the main node process (PID 7) only, and nothing happens.
This is different from when Kibana is run with systemd, because by default systemd will send a SIGTERM signal to ALL the processes of the cgroup, causing Kibana to stop gracefully.
As a workaround, I am currently using dumb-init in place of tini, because it behaves like systemd in this regards (sends signals to all spawn processes).
Example Dockerfile:
FROM docker.elastic.co/kibana/kibana:7.15.0
USER root
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init
USER kibana
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
CMD ["/usr/local/bin/kibana-docker"]