clamav-milter logrotate script fails (jaunty)

Bug #363804 reported by Matt LaPlante
8
Affects Status Importance Assigned to Milestone
clamav (Ubuntu)
Fix Released
High
Unassigned
Jaunty
Fix Released
High
Unassigned

Bug Description

Binary package hint: clamav-milter

A fresh install of clamav-milter (0.95.1+dfsg-1ubuntu1) creates the following file in logrotate.d:

root@prizm:/tmp# cat /etc/logrotate.d/clamav-milter
none {
     rotate 12
     weekly
     compress
     delaycompress
     create 640 clamav adm
     postrotate
     /etc/init.d/clamav-milter reload-log > /dev/null
     endscript
     }

Unfortunately this file is very broken and just errors out whenever logrotate runs it:

root@prizm:/tmp# /etc/cron.daily/logrotate
error: clamav-milter:1 unknown option 'none' -- ignoring line
error: clamav-milter:1 unexpected text
error: clamav-milter:10 unexpected }
error: found error in file clamav-milter, skipping

--------------------------------

root@prizm:/tmp# /etc/init.d/clamav-milter reload-log
 * Usage: /etc/init.d/clamav-milter {start|stop|restart|force-reload|status}

TEST CASE:

manually run /etc/cron.daily/logrotate (no need to do this as root or with sudo). Observer formatting errors:

error: clamav-milter:1 unknown option 'none' -- ignoring line
error: clamav-milter:1 unexpected text
error: clamav-milter:10 unexpected }
error: found error in file clamav-milter, skipping

Install the updated package. Run /etc/cron.daily/logrotate again and not the absence of clamav-milter related errors. If you run it without elevated privileges (sudo/root) it will fail to run, but will demonstrate the absence for formatting errors.

Revision history for this message
Imre Gergely (cemc) wrote :

It seems that the default clamav-milter.conf has syslog enabled instead of a file, and the postinst script doesn't find the LogFile setting and thus the logfile name, so it puts 'none' in /etc/logrotate.d/clamav-milter. Steps to correct:

- uninstall clamav-milter (without purge)
- remove /etc/logrotate.d/clamav-milter
- edit /etc/clamav/clamav-milter.conf like this:

LogSyslog false
LogFile /var/log/clamav/clamav-milter.log

- sudo apt-get install clamav-milter (the logrotate.d/clamav-milter file gets generated correctly)
- check the /var/log/clamav/clamav-milter.log exists
- run 'sudo /usr/sbin/logrotate /etc/logrotate.d/clamav-milter', should work without errors, and you should see the clamav-milter.log file rotated

It still gives an error about clamav-milter reload-log, not sure what should be there (I see only restart).

Revision history for this message
Imre Gergely (cemc) wrote :

I've fixed it a bit and uploaded the package to the clamav PPA (version 0.95.1+dfsg-1ubuntu1+ppa2). Please test it if you can, and update this bugreport. This fix will probably appear in -updates after the Jaunty release.

https://launchpad.net/~ubuntu-clamav/+archive/ppa

And here's a guide on activating the PPA:

https://help.launchpad.net/Packaging/PPA#Installing%20software%20from%20a%20PPA

Thank you.

Changed in clamav (Ubuntu Jaunty):
importance: Undecided → High
milestone: none → jaunty-updates
status: New → In Progress
description: updated
Revision history for this message
Scott Kitterman (kitterman) wrote :

Uploaded for post-release SRU. Note to Ubuntu SRU: Changes were done in coordination with the Debian maintainers and are expected in their next upload too.

Changed in clamav (Ubuntu Jaunty):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted clamav into jaunty-proposed-proposed; please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Matt LaPlante (cybrmatt) wrote : RE: [Bug 363804] Re: clamav-milter logrotate script fails (jaunty)

Looks Good To Me

tags: added: verification-done
removed: verification-needed
Revision history for this message
Imre Gergely (cemc) wrote :

By default clamav-milter doesn't log in a logfile, it uses syslog. Here's what I've done:

- purge the clamav-milter package if it's installed, then install it again
- remove it again without purging the config file
- edit the config file by adding the line

LogFile /var/log/clamav/clamav-milter.log

- apt-get install clamav-milter, keeping the local config file when it asks
- after the package gets installed, /etc/logrotate.d/clamav-milter gets generated based on the clamav-milter.conf file
- force a logrotate by running

/usr/sbin/logrotate -f /etc/logrotate.d/clamav-milter

- check /var/log/clamav for rotated clamav-milter.log.1

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package clamav - 0.95.1+dfsg-1ubuntu1.1

---------------
clamav (0.95.1+dfsg-1ubuntu1.1) jaunty-proposed; urgency=low

  * Fixed clamd apparmor profile based on pre-release testing
    - added permissions for qpsmtpd, p3scan spools
  * clamav-milter postinst/logrotate fix from pkg-clamav git repo (LP: #363804)
  * clamav-milter init script fix (LP: #363796)

 -- Imre Gergely <email address hidden> Mon, 20 Apr 2009 17:34:28 +0300

Changed in clamav (Ubuntu Jaunty):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

copied to karmic

Changed in clamav (Ubuntu):
milestone: jaunty-updates → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.