Hide Forgot
Description of problem: IMO current state how vdsm-logrotate is called is bad: - vdsm-logrotate is in /etc/cron.hourly # ls -l /etc/cron.hourly/vdsm-logrotate -rwxr-xr-x. 1 root root 477 Sep 29 09:49 /etc/cron.hourly/vdsm-logrotate - vdsm-logrotate in /etc/cron.hourly is called by: # cat /etc/cron.d/0hourly # Run the hourly jobs SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root 01 * * * * root run-parts /etc/cron.hourly Thus, if one wants to change job interval - eg. every 10 mins as 1 hour makes couple of GB big log file - he is not able to do it in easy way: 1. /etc/cron.hourly/vdsm-logrotate if still exists it would be called again every hour (it could conflict with already running logrotate started with different interval) 2. if /etc/cron.hourly/vdsm-logrotate would be deleted, every rpm update would put it back (ie. we are back on '1.') 3. doing workaround about 1. + 2. is silly (ie. chmod a-x /etc/cron.hourly/vdsm-logrotate) Thus a proposition: 1. new file in /etc/cron.d/ which would be just crontab-like file (calling vdsm-logrotate) 2. moving /etc/cron.hourly/vdsm-logrotate out of crond's dirs This way a sysadmin could easy change eg /etc/cron.d/vdsm-logroate to run '*/10' minutes and this configuration would be preserved during updates. Version-Release number of selected component (if applicable): vdsm-4.18.15-1.el7ev.x86_64 How reproducible: 100% Steps to Reproduce: 1. have easy way to define custom interval for vdsm-logrotate cron job 2. 3. Actual results: not sysadmin friendly Expected results: see descr above Additional info:
Plus following seems to be doable directly in logrote configuration with 'postrotate': ~~~ #!/bin/sh /usr/sbin/logrotate /etc/vdsm/logrotate/vdsm EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" fi if [ -d /var/log/core ] ; then /usr/bin/find /var/log/core -type f -name '*xz' -mtime +7 -exec /bin/rm -f '{}' \; EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /usr/bin/logger -t logrotate "ALERT clean old core files exited abnormally with [$EXITVALUE]" fi fi exit $EXITVALUE ~~~ Maybe an example: ~~~ ... sharedscripts postrotate /usr/bin/find /var/log/core -type f -name '*xz' -mtime +7 -exec /bin/rm -f '{}' \; endscript ... ~~~
Doesn't '-exec ...' is too expensive? Maybe pipe to xargs ?...
Yaniv - your thoughts here?
Will be nice to take some actions in this area. we'll get into it for later release
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.
1 hour of log create GB of log file? I never seen this. Jiri, can you share an example log file? I don't mind switching to more sysadmin friendly configuration, but I don't see how this is helpful.
(In reply to Nir Soffer from comment #6) > 1 hour of log create GB of log file? I never seen this. > Jiri, can you share an example log file? The content is not really relevant. > > I don't mind switching to more sysadmin friendly configuration, but I don't > see > how this is helpful.
(In reply to Jiri Belka from comment #7) > (In reply to Nir Soffer from comment #6) > > 1 hour of log create GB of log file? I never seen this. > > Jiri, can you share an example log file? > > The content is not really relevant. It is, vdsm should not produce so much log data, maybe you are using an older version that spammed the log? Please check with latest 4.0 or 4.1, and share with us one hour of debug log.
(In reply to Nir Soffer from comment #8) > (In reply to Jiri Belka from comment #7) > > (In reply to Nir Soffer from comment #6) > > > 1 hour of log create GB of log file? I never seen this. > > > Jiri, can you share an example log file? > > > > The content is not really relevant. > > It is, vdsm should not produce so much log data, maybe you are using an older > version that spammed the log? > > Please check with latest 4.0 or 4.1, and share with us one hour of debug log. feel free to close this, i'm not interested in this enhancement anymore.
please re-open if required in any case. we need good reason to change the current behavior