Hello
I have a 80GB /var/lib/docker/volumes/greenbone-community-edition_openvas_log_data_vol/_data/openvas.log.
Should I simply use logrotate? Should any container be restarted after that? I could not find any log settings using the GUI.
Thank you.
Here’s what I do to manage that
docker compose -f ~/greenbone-community-container/docker-compose.yml -p greenbone-community-edition exec openvas bash -c "cat /dev/null > /var/log/openvas/openvas.log"
Hi, ChanScan
I believe you have this command in a script called from cron.
To completely erase the log seems to be too radical. I think the log rotation is still a better option. But I am happy to know that you don’t need to restart the openvas container.
Thanks for your suggestion.
I recommend changing the log level by editing the compose file
configure-openvas:
...
command:
sed "s/127/16/" /etc/openvas/openvas_log.conf | sed 's/gvm/openvas/' > /mnt/openvas_log.conf
4 Errors.
8 Critical situation.
16 Warnings.
32 Messages.
64 Information.
128 Debug. (Lots of output.)
Hi PiRomant
Do you mean
sed "s/128/16/" ?
All sections of my openvas_log.conf have level=128 (Debug).
That’s a good idea to reduce the log file size. But it still would have to be rotated or deleted.
Thanks
I created a file named /etc/logrotate.d/openvas and it seems to be working.
/var/lib/docker/volumes/greenbone-community-edition_openvas_log_data_vol/_data/openvas.log {
daily
rotate 5
compress
missingok
notifempty
create 0640 root root
postrotate
/usr/bin/chmod ug+rw /var/lib/docker/volumes/greenbone-community-edition_openvas_log_data_vol/_data/openvas.log
endscript
}
Be careful with the permissions. For me, it caused problems as OpenVAS didn’t get write access and scans got stuck at 0%.
(openvas:512115): sd main-WARNING **: 08:09:17.344: init_logging: Can not open or create log file or directory. Please check permissions of log files listed in /etc/openvas/openvas_log.conf.
OSPD[8] 2025-06-16 08:09:17,346: WARNING: (ospd_openvas.openvas) Could not gather openvas settings. Reason Command ‘[‘openvas’, ‘-s’]’ returned non-zero exit status 1.
If you experience the same issue.
CHANGE:
/usr/bin/chmod ug+rw /var/lib/docker/volumes/greenbone-community-edition_openvas_log_data_vol/_data/openvas.log
TO:
/usr/bin/chmod 0666 /var/lib/docker/volumes/greenbone-community-edition_openvas_log_data_vol/_data/openvas.log
This topic was automatically closed after 90 days. New replies are no longer allowed.