From 5d90d3fcf9bceb0517fee4b08ebeea4c887fb777 Mon Sep 17 00:00:00 2001 From: catborise Date: Thu, 5 Nov 2026 14:39:33 +0300 Subject: [PATCH] fix(docker): gunicorn's and the job worker's output go to docker logs They went to files in the container that were never rotated and were lost on each recreate. docker logs is rotated (10 MB x 5) and outlives a restart. --- conf/runit/webvirtcloud-worker.sh | 3 ++- conf/runit/webvirtcloud.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/runit/webvirtcloud-worker.sh b/conf/runit/webvirtcloud-worker.sh index 6a2a599a..0126133d 100755 --- a/conf/runit/webvirtcloud-worker.sh +++ b/conf/runit/webvirtcloud-worker.sh @@ -3,4 +3,5 @@ # running jobs for 60 s and exits by itself. cd /srv/webvirtcloud || exit export WEBVIRTCLOUD_LOG_FILE=/srv/webvirtcloud/data/webvirtcloud-worker.log -exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/python3 manage.py run_worker >> /var/log/webvirtcloud-worker.log 2>&1 +# its output goes to the container's output (docker logs) +exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/python3 manage.py run_worker 2>&1 diff --git a/conf/runit/webvirtcloud.sh b/conf/runit/webvirtcloud.sh index 4cb81b0f..7ec782d2 100755 --- a/conf/runit/webvirtcloud.sh +++ b/conf/runit/webvirtcloud.sh @@ -1,4 +1,5 @@ #!/bin/sh # `/sbin/setuser www-data` runs the given command as the user `www-data`. cd /srv/webvirtcloud || exit -exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/gunicorn webvirtcloud.wsgi:application -c /srv/webvirtcloud/gunicorn.conf.py >> /var/log/webvirtcloud.log 2>&1 +# gunicorn's own and access log go to the container's output (docker logs) +exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/gunicorn webvirtcloud.wsgi:application -c /srv/webvirtcloud/gunicorn.conf.py 2>&1