Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 798933 - app-antivirus/clamav-0.103.3-r1: stabilisation (was: app-admin/clamav: logrotate.d file does command -v ... 2>/dev/null, causing cron output)
Summary: app-antivirus/clamav-0.103.3-r1: stabilisation (was: app-admin/clamav: logrot...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Stabilization (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Antivirus Team
URL:
Whiteboard:
Keywords: CC-ARCHES, PullRequest
Depends on:
Blocks:
 
Reported: 2021-06-27 18:06 UTC by Hank Leininger
Modified: 2021-10-04 00:47 UTC (History)
3 users (show)

See Also:
Package list:
app-antivirus/clamav-0.103.3-r1
Runtime testing required: ---
nattka: sanity-check+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hank Leininger 2021-06-27 18:06:14 UTC
app-antivirus/clamav got an updated logrotate script in commit https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76622421052176c051df0c19a518d6c064aa5e5e

That adds app-antivirus/clamav/files/clamav-milter.logrotate, which writes to stdout, triggering emails from cron when logrotate triggers, because of this bit:

  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

command -v writes to stdout, so one gets "/sbin/rc-service" emailed on openrc systems (and presumably something similar for systemd systems).

I count 11 instances of "if command -v..." in $PORTAGEDIR/*/*/files/* ; all redirect stdout or both stdout & stderr, except for this one and mail-filter/spamassassin/files/update-spamassassin-rules-r1.cron, although that script starts by redirecting stdout to /dev/null, so its output gets eaten.
Comment 1 Larry the Git Cow gentoo-dev 2021-06-29 04:40:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e66ceb053b88d41ef3a76fdecd3144495d62976

commit 5e66ceb053b88d41ef3a76fdecd3144495d62976
Author:     Hank Leininger <hlein@korelogic.com>
AuthorDate: 2021-06-27 18:11:39 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-06-29 04:12:01 +0000

    app-antivirus/clamav: fix logrotate file deployed when USE=milter
    
    command -v writes to stdout, not stderr, so the check for openrc/systemd
    was generating output and emails.
    
    Signed-off-by: Hank Leininger <hlein@korelogic.com>
    Closes: https://bugs.gentoo.org/798933
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Sam James <sam@gentoo.org>

 app-antivirus/clamav/clamav-0.103.3-r1.ebuild      | 234 +++++++++++++++++++++
 .../clamav/files/clamav-milter.logrotate-r1        |  25 +++
 2 files changed, 259 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d171c2f33400acf8517e5ddbf0ad9e53bf8db25

commit 5d171c2f33400acf8517e5ddbf0ad9e53bf8db25
Author:     Hank Leininger <hlein@korelogic.com>
AuthorDate: 2021-06-27 18:15:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-06-29 04:12:02 +0000

    mail-filter/spamassassin: Fixed command -v usage
    
    command -v writes to stdout, not stderr. As it happens this whole
    script is >/dev/null, so this instance is Mostly Harmless - unless
    someone copies it as an example of what to do.
    
    Signed-off-by: Hank Leininger <hlein@korelogic.com>
    Bug: https://bugs.gentoo.org/798933
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Closes: https://github.com/gentoo/gentoo/pull/21448
    Signed-off-by: Sam James <sam@gentoo.org>

 mail-filter/spamassassin/files/update-spamassassin-rules-r1.cron | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-20 18:26:16 UTC
x86 done
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-20 18:26:18 UTC
amd64 done
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-20 18:26:19 UTC
ppc64 done
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-21 16:35:03 UTC
ppc done
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-26 04:59:11 UTC
arm done
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-04 00:47:01 UTC
arm64 done

all arches done