From eeb55a014b51275cd8922cff3db7e4c7fc40a4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 30 Jan 2024 11:30:31 +0100 Subject: [PATCH] Change: Don't fork gsad during container startup Log all output of gsad to stderr, run gsad in foreground (don't fork) and write output via tee to /var/log/gvm/gsad.log. This simplifies the statup of gsad within the container and actually the running daemon process is tracked by docker instead of the tail process. --- .docker/gsad_log.conf | 8 ++++---- .docker/start-gsad.sh | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.docker/gsad_log.conf b/.docker/gsad_log.conf index 8659480974..ad26f80176 100644 --- a/.docker/gsad_log.conf +++ b/.docker/gsad_log.conf @@ -2,26 +2,26 @@ prepend=%t %s %p separator=: prepend_time_format=%Y-%m-%d %Hh%M.%S %Z -file=/var/log/gvm/gsad.log +file=- level=127 [gsad gmp] prepend=%t %s %p separator=: prepend_time_format=%Y-%m-%d %Hh%M.%S %Z -file=/var/log/gvm/gsad.log +file=- level=127 [gsad http] prepend=%t %s %p separator=: prepend_time_format=%Y-%m-%d %Hh%M.%S %Z -file=/var/log/gvm/gsad.log +file=- level=127 [*] prepend=%t %s %p separator=: prepend_time_format=%Y-%m-%d %Hh%M.%S %Z -file=/var/log/gvm/gsad.log +file=- level=16 diff --git a/.docker/start-gsad.sh b/.docker/start-gsad.sh index d4394a9862..52941d62f9 100644 --- a/.docker/start-gsad.sh +++ b/.docker/start-gsad.sh @@ -1,9 +1,6 @@ #!/bin/sh -[ -z "$GSAD_ARGS" ] && GSAD_ARGS="--http-only" +[ -z "$GSAD_ARGS" ] && GSAD_ARGS="-f --http-only" echo "starting gsad" -gsad $GSAD_ARGS || - (cat /var/log/gvm/gsad.log && exit 1) - -tail -f /var/log/gvm/gsad.log +gsad $GSAD_ARGS 2>&1 | tee /var/log/gvm/gsad.log