Bug 1376815

Summary: Update logrotate script for clamav
Product: [Fedora] Fedora EPEL Reporter: Nicolas Chauvet (kwizart) <kwizart>
Component: clamavAssignee: Nick Bebout <nb>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el6CC: janfrode, ms, nathanael, nb, orion, redhat-bugzilla, rhbugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: clamav-0.99.2-2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1381211 (view as bug list) Environment:
Last Closed: 2017-03-03 11:35:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1381211    
Attachments:
Description Flags
Update logrotate script none

Description Nicolas Chauvet (kwizart) 2016-09-16 13:20:45 UTC
Created attachment 1201642 [details]
Update logrotate script

Description of problem:
On every logrotate (monthly) run for clamav, the following message can be seen under certain configuration:
error: running non-shared postrotate script for /var/log/clamd.smtpd.log of '/var/log/clamd.smtpd.log'

Version-Release number of selected component (if applicable):
Current clamav in EPEL6 and later.

How reproducible:
Every month as seen in logwatch

Steps to Reproduce:
1. install clamav 
2. enable smtpd
3.

Actual results:
The error is seen in the log

Expected results:
We should see no error

Additional info:
As seen in rhbz#1249725 the fix is about to redirect the standard output.
Patch attached

Comment 1 Orion Poplawski 2016-09-16 18:06:19 UTC
I don't quite follow.  The clamd package's logrotate script does not deal with /var/log/clamd.smtpd.log, but with /var/log/clamav/clamd.log.  You must have a custom logrotate script.

Comment 2 Nicolas Chauvet (kwizart) 2016-09-16 19:28:48 UTC
(In reply to Orion Poplawski from comment #1)
> I don't quite follow.  The clamd package's logrotate script does not deal
> with /var/log/clamd.smtpd.log, but with /var/log/clamav/clamd.log.  You must
> have a custom logrotate script.
wrong paste then

Comment 3 Orion Poplawski 2016-09-16 20:01:16 UTC
So you also get error messages about /var/log/clamav/clamd.log?  So there is no "clamd" process?

Comment 4 Nicolas Chauvet (kwizart) 2016-10-03 13:11:43 UTC
(In reply to Orion Poplawski from comment #3)
> So you also get error messages about /var/log/clamav/clamd.log?  So there is
> no "clamd" process?

Thx for your notice. Actually I've reported it on the wrong component.
There is indeed a /var/log/clamd.clamsmtp/clamsmtpd.log that comes from a separate clamsmtp package. (filled a separate issue about this).

Now both the clamd and clamd.clamsmtp logrotate files should be derived from this clamd.logrotate file (as it's also provided in clamav-devel as template for other services based on clamd).

Comment 5 Nicolas Chauvet (kwizart) 2016-10-03 13:29:21 UTC
(In reply to Orion Poplawski from comment #3)
> So you also get error messages about /var/log/clamav/clamd.log?  So there is
> no "clamd" process?

I think it's easily reproducible if clamav got installed, but the service isn't started. That's the reason the logrotate postrotate command should be standardized to not report error code and even any output.