public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michael Orlitzky" <mjo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
Date: Wed, 23 Sep 2020 03:34:47 +0000 (UTC)	[thread overview]
Message-ID: <1600831404.76622421052176c051df0c19a518d6c064aa5e5e.mjo@gentoo> (raw)

commit:     76622421052176c051df0c19a518d6c064aa5e5e
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 22 13:24:36 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Sep 23 03:23:24 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76622421

app-antivirus/clamav: new logrotate files for v0.103.0.

Now that each ClamAV daemon has its own OpenRC service, we
separate the logrotate entries as well. This fixes an old
bug where we relied on the service manager being OpenRC.

Closes: https://bugs.gentoo.org/508520
Closes: https://bugs.gentoo.org/709780
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 app-antivirus/clamav/clamav-0.103.0.ebuild         |  5 ++++-
 app-antivirus/clamav/files/clamav-milter.logrotate | 25 ++++++++++++++++++++++
 app-antivirus/clamav/files/clamd.logrotate         | 17 +++++++++++++++
 app-antivirus/clamav/files/freshclam.logrotate     | 17 +++++++++++++++
 4 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/app-antivirus/clamav/clamav-0.103.0.ebuild b/app-antivirus/clamav/clamav-0.103.0.ebuild
index 9a1d28f8920..f5e3d508cf5 100644
--- a/app-antivirus/clamav/clamav-0.103.0.ebuild
+++ b/app-antivirus/clamav/clamav-0.103.0.ebuild
@@ -133,7 +133,10 @@ src_install() {
 		fi
 
 		insinto /etc/logrotate.d
-		newins "${FILESDIR}"/clamav.logrotate clamav
+		newins "${FILESDIR}/clamd.logrotate" clamd
+		newins "${FILESDIR}/freshclam.logrotate" freshclam
+		use milter && \
+			newins "${FILESDIR}/clamav-milter.logrotate" clamav-milter
 
 		# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
 		sed -i -e "s:^\(Example\):\# \1:" \

diff --git a/app-antivirus/clamav/files/clamav-milter.logrotate b/app-antivirus/clamav/files/clamav-milter.logrotate
new file mode 100644
index 00000000000..24782df604b
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-milter.logrotate
@@ -0,0 +1,25 @@
+# This script is intended to rotate the logs for clamav-milter in its
+# default configuration on Gentoo, where clamav-milter writes to its
+# own log file but does not rotate that file itself. The clamav-milter
+# daemon is capable of rotating its own logs; if you have "LogRotate
+# yes" in clamav-milter.conf then you do not need this script (and
+# should disable it). Likewise, if you are logging to syslog
+# (LogSyslog yes), this is redundant.
+#
+# This is more complicated than the clamd/freshclam scripts because
+# the milter doesn't yet reopen its log files when it receives a
+# SIGHUP. See https://bugzilla.clamav.net/show_bug.cgi?id=12615
+# for that. Instead we have to attempt OpenRC/systemd service
+# restarts on (only) the machines that support them.
+/var/log/clamav/clamav-milter.log {
+  su clamav clamav
+  missingok
+  postrotate
+    if command -v rc-service 2>/dev/null; then
+      rc-service clamav-milter status 2>/dev/null 1>&2 && rc-service clamav-milter restart 1>/dev/null
+    fi
+    if command -v systemctl 2>/dev/null; then
+      systemctl try-restart clamav-milter
+    fi
+  endscript
+}

diff --git a/app-antivirus/clamav/files/clamd.logrotate b/app-antivirus/clamav/files/clamd.logrotate
new file mode 100644
index 00000000000..68ee9b36166
--- /dev/null
+++ b/app-antivirus/clamav/files/clamd.logrotate
@@ -0,0 +1,17 @@
+# This script is intended to rotate the logs for clamd in its default
+# configuration on Gentoo, where clamd writes to its own log file but
+# does not rotate that file itself. The clamd daemon is capable of
+# rotating its own logs; if you have "LogRotate yes" in clamd.conf
+# then you do not need this script (and should disable it). Likewise,
+# if you are logging to syslog (LogSyslog yes), this is redundant.
+/var/log/clamav/clamd.log {
+  su clamav clamav
+  missingok
+  postrotate
+    if test -f /run/clamd.pid; then
+      /bin/kill -HUP $(cat /run/clamd.pid)
+    else
+      true
+    fi
+  endscript
+}

diff --git a/app-antivirus/clamav/files/freshclam.logrotate b/app-antivirus/clamav/files/freshclam.logrotate
new file mode 100644
index 00000000000..ba6b5de3ba1
--- /dev/null
+++ b/app-antivirus/clamav/files/freshclam.logrotate
@@ -0,0 +1,17 @@
+# This script is intended to rotate the logs for freshclam in its default
+# configuration on Gentoo, where freshclam writes to its own log file but
+# does not rotate that file itself. The freshclam daemon is capable of
+# rotating its own logs; if you have "LogRotate yes" in freshclam.conf
+# then you do not need this script (and should disable it). Likewise,
+# if you are logging to syslog (LogSyslog yes), this is redundant.
+/var/log/clamav/freshclam.log {
+  su clamav clamav
+  missingok
+  postrotate
+    if test -f /run/freshclam.pid; then
+      /bin/kill -HUP $(cat /run/freshclam.pid)
+    else
+      true
+    fi
+  endscript
+}


             reply	other threads:[~2020-09-23  3:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  3:34 Michael Orlitzky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-27 11:32 [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/ Michael Orlitzky
2024-10-27 11:22 Andreas K. Hüttel
2024-09-23 11:48 Matt Jolly
2024-09-23 11:12 Matt Jolly
2024-06-24 11:05 Matt Jolly
2022-12-05 21:03 Thomas Raschbacher
2021-10-16 12:26 Thomas Raschbacher
2021-02-09 19:48 Michael Orlitzky
2020-09-23  3:34 Michael Orlitzky
2020-09-20 19:35 Michael Orlitzky
2020-06-09  1:53 Michael Orlitzky
2019-11-25 16:27 Lars Wendler
2019-11-25  4:08 Michael Orlitzky
2019-07-31 12:47 Lars Wendler
2019-07-31 12:07 Lars Wendler
2018-03-02 18:42 Thomas Raschbacher
2018-02-23 19:00 Thomas Deutschmann
2017-12-24 23:12 Mike Gilbert
2017-04-23 20:26 Jeroen Roovers
2016-12-25 18:13 Sergei Trofimovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1600831404.76622421052176c051df0c19a518d6c064aa5e5e.mjo@gentoo \
    --to=mjo@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox