fluentd-docker-image
fluentd-docker-image copied to clipboard
Container exits with code 143 on SIGTERM
All recent versions of the Fluentd Docker image exit with code 143 when receiving a SIGTERM (i.e. docker stop, docker-compose stop, or docker-compose down). Is this expected behavior, or should containers be exiting with code 0 on SIGTERM?
Only fluent/fluentd:ubuntu-base exits with code 0. Coincidentally we do use the ubuntu image, but because we wrap our fluentd -v -c .... command in a shell script and use that as the container's CMD, we get exit code 137 when sending SIGTERM to our container. In addition, we are looking to move off of the ubuntu image as it's no longer supported.
$ docker ps -a
IMAGE COMMAND CREATED STATUS
fluent/fluentd:ubuntu-base "/bin/sh -c 'exec ..." About a minute ago Exited (0) 18 seconds ago
fluent/fluentd:edge-debian "/bin/entrypoint.s..." 3 minutes ago Exited (143) 3 minutes
fluent/fluentd:edge "/bin/entrypoint.s..." 3 minutes ago Exited (143) 3 minutes
fluent/fluentd:debian "/bin/entrypoint.s..." 4 minutes ago Exited (143) 3 minutes
fluent/fluentd:latest "/bin/entrypoint.s..." 4 minutes ago Exited (143) 4 minutes
It must have to do with the fact that since https://github.com/fluent/fluentd-docker-image/pull/78 fluentd process inside the container runs as a child under dumb-init which performs proper signal forwarding (see here for a detailed explanation). Not sure why ubuntu-base would be an exception
ubuntu-base is older image and it doesn't include recent changes.
@repeatedly right, I understand that and we'd like to stop using it soon.
My question was more of whether the newer images should be exiting with code 143, and if that should cause any concern for the fluentd process stopping gracefully. Thanks!