[Pkg-clamav-devel] LogRotate, create user and the option in the config

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue Mar 25 15:55:56 UTC 2014


Hi Sebastian,

On 24.03.2014 21:36, Sebastian Andrzej Siewior wrote:
> I've been testing a little. I stumbled uppon something that I assumed
> that it was fixed:

Thanks for testing: You found two bugs. I pushed fixes to git.

> - after a fresh intallation LogRotate is set to true and the files in
>    logrotate.d are created

So far so good.

> - After reconfigure (dpkg-reconfigure clamav-base) and switching the
>    clamd user to bla I have:
>    /etc/clamav/clamd.conf: User bla
>    /etc/clamav/clamd.conf: LogRotate true
>    /etc/logrotate.d/clamav-daemon:     create 640  clamav adm
>    /etc/logrotate.d/clamav-freshclam:     create 640  clamav adm
>    /etc/logrotate.d/clamav-milter:     create 640  clamav adm
>    and I think clamav-daemon's should be swich to "bla adm"

It would be nice, if this would read "bla adm", but I think one has to 
additionally run dpkg-reconfigure clamav-{daemon,freshclam,milter} to 
achieve this. But that was broken: [ -n "$LogRotate" ] is true 
independent of whether $LogRotate is 'true' or 'false'.
[ "$LogRotate" = "true" ] should be correct.

> - After reconfigure and disabling logrotate I still have the files in
>    logrotate.d and LogRotate is set to true
> - running reconfigure again keeps "lograte enable" as pre default so I
>    assume that the change was not saved.

LogRotate is still true, because after reading the debconf setting, the 
postinst reads the configuration file and thus again the old value.
This worked for the old values, because the postinst script used 
variables like $user instead of the $User from the configuration file.

> - running reconfigure and "disable automatic" handling and then starting
>    it again with "yes do automatic" followed by "no lograte please"
>    results in
>    /etc/clamav/clamav-milter.conf:LogRotate true
>    /etc/clamav/clamd.conf:LogRotate false
>    /etc/clamav/freshclam.conf:LogRotate true
>    and the lograte.d files are unchanged.
> - running reconfigure again and enabling "logrotate" seems to make a
>    difference.
>
> Now I am confused because I tested this and it worked. Now it seems
> that it does not work anymore. Did it break or is there somewhere old
> that stops it from working? It seems that the .conf files are not always
> udpated (LogRoate isn't always, User is always) and the logrotate.d are
> never.
> Just before sending I removed and re-installed clamav-daemon and milter
> and got:
> 	/etc/logrotate.d/clamav-daemon:     create 640  bla adm
> 	/etc/logrotate.d/clamav-freshclam:     create 640  clamav adm
> 	/etc/logrotate.d/clamav-milter:     create 640  clamav adm
>
> But the logrotate.d should be updated once the user has been changed,
> right? And the files should be dropped once LogRotate is set to false or
> this two different things which I mix up?

Please confirm that this is fixed now, or yell if it is not.

Best regards,
Andreas




More information about the Pkg-clamav-devel mailing list