commit: 0a122a0f71c4bd314bd97f712d1aba6d360d47bb Author: Giuseppe Foti <foti.giuseppe <AT> gmail <DOT> com> AuthorDate: Sat Sep 7 21:36:36 2024 +0000 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org> CommitDate: Sat Sep 14 09:57:13 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a122a0f
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 <AT> gmail.com> Signed-off-by: Florian Schmaus <flow <AT> gentoo.org> net-analyzer/notus-scanner/files/notus-scanner.logrotate | 13 +++++++++++++ ...nner-22.6.3-r1.ebuild => notus-scanner-22.6.3-r3.ebuild} | 12 +++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/net-analyzer/notus-scanner/files/notus-scanner.logrotate b/net-analyzer/notus-scanner/files/notus-scanner.logrotate new file mode 100644 index 000000000000..195611c2959e --- /dev/null +++ b/net-analyzer/notus-scanner/files/notus-scanner.logrotate @@ -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 +} diff --git a/net-analyzer/notus-scanner/notus-scanner-22.6.3-r1.ebuild b/net-analyzer/notus-scanner/notus-scanner-22.6.3-r3.ebuild similarity index 87% rename from net-analyzer/notus-scanner/notus-scanner-22.6.3-r1.ebuild rename to net-analyzer/notus-scanner/notus-scanner-22.6.3-r3.ebuild index 9ac39d6372b9..3e9f94355696 100644 --- a/net-analyzer/notus-scanner/notus-scanner-22.6.3-r1.ebuild +++ b/net-analyzer/notus-scanner/notus-scanner-22.6.3-r3.ebuild @@ -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
