johann - 2018-05-24

CLIENT: win7/64
SERVER: Linux 2.6.32-696.18.7.el6.x86_64
APP's:
webmin.noarch 1.881-1
Logrotate version 3.7.8

i was looking into something and using webmin when i decided to use webmin's logrotate page to separate nginx's access and error logs in order to keep differing history depths. webmin did so and reported no errors. on the next scheduled rotation i received notification of a failure for /var/log/nginx/access.log rotating to /var/log/nginx/rotated/.

i went to a terminal page for that server and discovered that /var/log/nginx/error.log was rotated successfully. i opened /etc/logrotate.d/access.log.conf with nano and discovered that the file ended with three (3) pairs of '}LF' instead of only one (1). i deleted the surplus of two (2).

i then re-accessed the webmin page on that server and observed that the logrotate landing page seemed correct. i entered the /var/log/nginx/access.log details page and everything seemed correct there as well. since this rotation appears first on the logrotation landing page, i decided to add a note to the post-rotate section that would be visible on the landing page and apply to all rotations since these config's are used by others. i saved the change and exited webmin.

to double-check, i went back to the server's terminal page and used nano to load the new /etc/logrotate.d/access.log.conf again and discovered:

/var/log/nginx/access.log {
rotate 13
compress
delaycompress
nocopytruncate
ifempty
nomissingok
create 660 web root
olddir /var/log/nginx/rotated
dateext
nomail
nosharedscripts
postrotate
'# NOTE: 'logrotate' CANNOT BE "FORCED" if a rotated file already exists for the same day
'# (e.g., no file can be rotated more than once per day)
'# this allows 'cron' to run multiple times per day without over-amping on rotations
/bin/kill -HUP cat /var/run/rsyslogd.pid
endscript
}
/bin/kill -HUP cat /var/run/rsyslogd.pid
endscript
}
NOTE: formatting of the file output, supra, was manually adjusted for display/clarity in this report. except for the first and last four (4) lines of the file, each line is preceded by a single tab character. the '#' characters had to be preceded by a single-quote to prevent "headlining" by the SF editor for this comment. this formatting is in line with what logrotate expects.

obviously, just like the superfluous two (2) pairs of '}LF' previously, the last three (3) lines of this new file also are in error.

i have no way of knowing if it is significant, but the problems have been limited to the alphabetically-first file in the /etc/logrotate.d/ directory.

the errors in this file actually cascade in webmin's win client into the alphabetically-second file. see the bug report subsequent to this one for details.