docker-splunk
docker-splunk copied to clipboard
Splunk Docker container not trapping SIGTERM or SIGINT
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.
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 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.