Thanks to Marina to brining this up! vdsm installs: /etc/cron.hourly/vdsm-logrotate --- /usr/sbin/logrotate /etc/logrotate.d/vdsm --- And of course: /etc/logrotate.d/vdsm The outcome is that daily run of logrotate, runs a logrotate instance with /etc/logrotate.conf which handles /etc/logrotate.d/vdsm within its configuration context. And... the vdsm cron that runs logrotate with /etc/logrotate.d/vdsm ignoring the system configuration. This is invalid usage of logrotate, as one should choose which configuration to run. Options: [SIMPLE, LESS RECOMMENDED] 1. Move /etc/logrotate.d/vdsm to /etc/vdsm/logrotate/vdsm, and modify cron script to use this specific configuration. This way the system logrotate will not handle vdsm logs. 2. Execute hourly /etc/cron.daily/logrotate instead of daily, regardless of vdsm, and drop the explicit logrotation of vdsm, also recommended to add minsize XXX and daily into logrotate, to avoid rotation without reason. The side effect is that other logs will be rotated in higher interval if actually needed by their configuration.
Could you explain why option 2, with its wider system-wide effects, is more recommended? All we want to do is stop the effect of logrotate.conf on vdsm, and moving /etc/logrotate.d/vdsm away does just that. An even simpler fix would be to add an explicit 'nodateext' to /etc/logrotate.d/vdsm, which would force "normal" extension to vdsm.log even when executed via /etc/logrotate.conf. This would keep the ugly race between the hourly and the daily runs, but would make them unnoticeable again.
oh, and if "minsize" is to replace "size" in the conf, please test it thoroughly. I recall that it had non-intuitive semantics.
(In reply to Dan Kenigsberg from comment #1) > Could you explain why option 2, with its wider system-wide effects, is more > recommended? All we want to do is stop the effect of logrotate.conf on vdsm, > and moving /etc/logrotate.d/vdsm away does just that. you should not override sysadmin preferences. it is up to component to provide logrotate configuration. it is up to sysadmin to decide where/when/how it will be used. any change in /etc/logrotate.conf is expected to effect the entire logrotation of the system. > An even simpler fix would be to add an explicit 'nodateext' to > /etc/logrotate.d/vdsm, which would force "normal" extension to vdsm.log even > when executed via /etc/logrotate.conf. This would keep the ugly race between > the hourly and the daily runs, but would make them unnoticeable again. see above. if you use logrotate and also install it so that the system logrotation picks it up, you do not override the system setting just for fun. either create your custom rotation move it out from the system logrotation configuration, you can use logrotate or any other custom program you may like. this is bad practice as sysadmin that is not aware of your inventions is incapable of managing his system using best practices. or use the logrotate as expected.
(In reply to Alon Bar-Lev from comment #3) > > you should not override sysadmin preferences. I thought that your option 2 was about doing just that (making the system logrotate run every hour). imo your option 1 is precise and favorable.
(In reply to Dan Kenigsberg from comment #4) > (In reply to Alon Bar-Lev from comment #3) > > > > you should not override sysadmin preferences. > > I thought that your option 2 was about doing just that (making the system > logrotate run every hour). imo your option 1 is precise and favorable. making logrotate run every hour should not have negative effect if run without force, logrotate is designed to be run also at different intervals. in ovirt-engine we did not modify the logrotate scheduling, but suggest to add it to hourly or higher if the system is loaded.
Please backport to the ovirt-3.5 branch - it is a 3.5.0 bug.
ok, vdsm-4.16.3-2.el6.x86_64 changed to 50k to see if it works. [root@dell-r210ii-04 yum.repos.d]# ls -l /etc/vdsm/logrotate/vdsm /etc/cron.hourly/vdsm-logrotate -rwxr-xr-x. 1 root root 484 Sep 5 14:23 /etc/cron.hourly/vdsm-logrotate -rw-r--r--. 1 root root 315 Sep 5 14:34 /etc/vdsm/logrotate/vdsm [root@dell-r210ii-04 yum.repos.d]# ls -l /var/log/vdsm/ total 100 drwxr-xr-x. 2 vdsm kvm 4096 Sep 2 18:04 backup -rw-r--r--. 1 vdsm kvm 475 Sep 5 13:44 connectivity.log -rw-r--r--. 1 vdsm kvm 1037 Sep 5 13:45 mom.log -rw-r--r--. 1 root root 24514 Sep 5 13:49 supervdsm.log -rw-r--r--. 1 root root 4731 Sep 5 13:44 upgrade.log -rw-r--r--. 1 vdsm kvm 48458 Sep 5 14:35 vdsm.log -rw-r--r--. 1 vdsm kvm 7556 Sep 5 14:34 vdsm.log.1.xz