docker-splunk icon indicating copy to clipboard operation
docker-splunk copied to clipboard

Splunk Docker container not trapping SIGTERM or SIGINT

Open BSonPosh opened this issue 4 years ago • 2 comments
trafficstars

Has anyone experience issues with the trap teardown SIGINT SIGTERM not actually being "trapped" Using this

docker run --name so1 --hostname so1 -p 8000:8000 \
              -e "SPLUNK_PASSWORD=P@ssw0rd!" \
              -e "SPLUNK_START_ARGS=--accept-license" \
              -d splunk/splunk:latest

If I send docker stop -t 60 so1 or docker kill --signal=SIGTERM so1 the container dies instantly. I would expect the SIGTERM to trigger a splunk stop but that does not happen. This causes concern for data integrity.

BSonPosh avatar May 02 '21 12:05 BSonPosh

I'll double-check the behavior of this, but this should be caught here: https://github.com/splunk/docker-splunk/blob/develop/splunk/common-files/entrypoint.sh#L28-L33

nwang92 avatar May 12 '21 17:05 nwang92

@nwang92 I also expected the trap to work but it does not... I suspect its a problem with Docker but IMO this is a potentially data loss scenario. My research has led me to believe its because you use a shell script and docker isn't properly sending the SIGTERM to the script.

BSonPosh avatar May 12 '21 17:05 BSonPosh