Yesterday /var/log/messages on one server was found empty. Looking into /var/ shows:
messages
messages-20161125
messages-20161127
But trying to access messages-20161127 hangs the process. tail, cat, etc, all never return, cannot be interrupted and even kill -9 does not help. (ps shows the process in IO wait)
lsof | grep messages shows: rsyslogd /var/messages-20161127
So rsyslog is still using the old version of the file and did not close it.
Is this a problem with the configuration of rsyslog? logrotate? Any tips on how to avoid this?
Thanks!
EDIT
After rebooting we could regain access to messages-20161127. There were messages about "task sync:30312 blocked for more than 120 seconds". The time of the the logrotate didn't match the sync error message but perhaps they are related.
So perhaps root cause is the filesystem got hung? /var/log/messages is on the root filesystem. Everything else seemed to be running normally...
See my other question slow/frozen ext4 // task sync blocked on big mostly write only server