Skip to content

Commit

Permalink
Change: Don't fork gsad during container startup
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bjoernricks committed Jan 30, 2024
1 parent 89f758a commit eeb55a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .docker/gsad_log.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 2 additions & 5 deletions .docker/start-gsad.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit eeb55a0

Please sign in to comment.