net-analyzer/notus-scanner: Adds a check on log's dir owner and the logfile to logrotate

Closes: https://bugs.gentoo.org/937564
Signed-off-by: Giuseppe Foti <foti.giuseppe@gmail.com>
Signed-off-by: Florian Schmaus <flow@gentoo.org>
This commit is contained in:
Giuseppe Foti
2024-09-14 11:57:13 +02:00
committed by Florian Schmaus
parent ff33e272cd
commit 0a122a0f71
2 changed files with 24 additions and 1 deletions
@@ -0,0 +1,13 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Daemon ignore HUP so we use 'copytruncate' instead of 'create'
# with safe file size to prevent losing log entries.
/var/log/gvm/notus-scanner.log {
compress
missingok
notifempty
sharedscripts
copytruncate
maxsize 10M
}
@@ -20,7 +20,7 @@ DEPEND="
net-libs/paho-mqtt-c
>=dev-python/psutil-5.9[${PYTHON_USEDEP}]
>=dev-python/python-gnupg-0.5.1[${PYTHON_USEDEP}]
<dev-python/packaging-24.1[${PYTHON_USEDEP}]
<dev-python/packaging-24.2[${PYTHON_USEDEP}]
>=dev-python/paho-mqtt-1.5.1[${PYTHON_USEDEP}]
$(python_gen_cond_dep '
<dev-python/tomli-3[${PYTHON_USEDEP}]
@@ -69,6 +69,16 @@ python_install() {
fowners -R gvm:gvm /var/lib/notus
fi
# Adding notus-scanner.log to logrotate
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotate" "${PN}"
# Set proper permissions on required files/directories
keepdir /var/log/gvm
if ! use prefix; then
fowners -R gvm:gvm /var/log/gvm
fi
newinitd "${FILESDIR}/${PN}.initd" "${PN}"
systemd_dounit config/${PN}.service