Log file rotation fails, no error.

5 posts / 0 new
Last post
#1 Tue, 06/23/2015 - 02:37
simber

Log file rotation fails, no error.

My log files seem to never rotate (at least I only checked the apache access_logs), so I tried to do a forced log rotation, this was the output:

Forcing the immediate rotation of all log files ..

 .. failed! See the output above for the reason why.

No error is specified..

I also checked the directory and the file size of the log files is still the same, so the command did indeed not execute as it should have. (100MB+ access_log).

Any ideas as to what may be the cause?

Tue, 06/23/2015 - 02:43
simber

Actually the first time I did get "done". However, as said in the previous post, the size of the access_log is still the same. settings for minimum and maximum log size are set to default. Do I need to change this?

I'm unsure what to fill in, why is there a maximum option anyway?

Tue, 06/23/2015 - 10:27
andreychek

Howdy,

What happens if you run this command as root:

logrotate -d -f /etc/logrotate.conf

Do you see any errors?

-Eric

Wed, 06/24/2015 - 03:36
simber

It seems to ignore the domain.conf files because of bad file mode. Any idea what that means?

[root@host]# logrotate -d -f /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file clamav-update
reading config file httpd
reading config file mailman
reading config file mariadb
reading config file named
reading config file ppp
reading config file proftpd
reading config file sa-update
reading config file syslog
reading config file wpa_supplicant
Ignoring domain.com conf because of bad file mode.
reading config file yum
Wed, 06/24/2015 - 03:46
simber

OK, I set the chmod to 644 for those config files (though i didn't create them, so seems to be a webmin bug).

Then did another forced log rotate; now the config files are included, but the result is still the same; logs are not rotated and no new ones / renmaes either as in this output...

rotating pattern: /var/log/virtualmin/domain_1_access_log /var/log/virtualmin/domain_1_error_log  forced from command line (5 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/virtualmin/domain_1_access_log    
  log needs rotating
considering log /var/log/virtualmin/domain_1_error_log
  log needs rotating
rotating log /var/log/virtualmin/domain_1_access_log, log->rotateCount is 5
dateext suffix '-20150624'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/virtualmin/domain_1_error_log, log->rotateCount is 5
dateext suffix '-20150624'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/virtualmin/domain_1_access_log to /var/log/virtualmin/domain_1_access_log-20150624
creating new /var/log/virtualmin/domain_1_access_log mode = 0660 uid = 502 gid = 48
renaming /var/log/virtualmin/domain_1_error_log to /var/log/virtualmin/domain_1_error_log-20150624
creating new /var/log/virtualmin/domain_1_error_log mode = 0660 uid = 502 gid = 48
running postrotate script
running script with arg /var/log/virtualmin/domain_1_access_log     /var/log/virtualmin/domain_1_error_log : "
    service httpd reload ; sleep 5
"
compressing log with: /bin/gzip
compressing log with: /bin/gzip
Topic locked