From 2b26b4648f4ffc55914faf54557630de03024893 Mon Sep 17 00:00:00 2001 From: Vladimir Volodko Date: Mon, 22 Apr 2019 11:38:06 +0700 Subject: [PATCH] Fix stopping container with running xtail Always exec shiny-server as container's main process and run `xtail` in background. So, both processes stop on SIGTERM as expected. --- shiny-server.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/shiny-server.sh b/shiny-server.sh index 1f0ac05..f16fb54 100755 --- a/shiny-server.sh +++ b/shiny-server.sh @@ -4,13 +4,11 @@ mkdir -p /var/log/shiny-server chown shiny.shiny /var/log/shiny-server -if [ "$APPLICATION_LOGS_TO_STDOUT" = "false" ]; +if [ "$APPLICATION_LOGS_TO_STDOUT" != "false" ]; then - exec shiny-server 2>&1 -else - # start shiny server in detached mode - exec shiny-server 2>&1 & + # push the "real" application logs to stdout with xtail in detached mode + exec xtail /var/log/shiny-server/ & +fi - # push the "real" application logs to stdout with xtail - exec xtail /var/log/shiny-server/ -fi \ No newline at end of file +# start shiny server +exec shiny-server 2>&1