On Fri, Jan 09, 2015 at 10:57:45AM +0100, Lukas Slebodnik wrote:
> ehlo,
>
> glustefs, libvirtd use the same aproach with delaycompress for log files.
>
> Simple patch is attached.
>
> LS
> From 60747736361479fb372ebf4e97477ce0bd6dbced Mon Sep 17 00:00:00 2001
> From: Lukas Slebodnik <lslebodn(a)redhat.com>
> Date: Fri, 9 Jan 2015 10:50:59 +0100
> Subject: [PATCH] logrotate: Fix warning file size changed while zipping
>
> Postpone compression of the previous log file to the next rotation cycle.
> This only has effect when used in combination with compress. We need to use it
> because we cannot tell sssd to close log files and thus sssd processes might
> continue writing to the previous log file for some time.
>
> Resolves:
>
https://fedorahosted.org/sssd/ticket/2547
> ---
> src/examples/logrotate | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/examples/logrotate b/src/examples/logrotate
> index
9df721f2a989a3f64e20097de3117587288f5039..ecf0c6102873e08dede3c6e7909fcf2a6379d4cf 100644
> --- a/src/examples/logrotate
> +++ b/src/examples/logrotate
> @@ -5,6 +5,7 @@
> sharedscripts
> rotate 2
> compress
> + delaycompress
> postrotate
> /bin/kill -HUP `cat /var/run/sssd.pid 2>/dev/null` 2> /dev/null ||
true
> endscript
> --
> 2.1.0
>
Makes sense. Also from logrotate man page:
delaycompress
Postpone compression of the previous log file to the next rotation
cycle. This only has effect when used in combination with compress. It can be used when
some
program cannot be told to close its logfile and thus might continue writing
to the previous log file for some time.
So keeping both compress and delaycompress is correct.
In case the previous reply wasn't clear: ACK
master: 565eb6fa43e74e2fbfff00dc29fdb20c5544a3d2
sssd-1-12: 1d39190e64b84e12c41706d450fc9531888707c0