rsyslog没有释放文件句柄

时间:2013-11-28 09:05:47

标签: logging rsyslog

我在RHEL 6.4下配置了rsyslog,将log4j文件发送到中央rsyslog服务器。这有效,直到旋转应用程序日志文件。 rsyslog仍尝试读取文件但未找到任何数据:

9332.655820752:7f609100d700: strm 0x7f607c005580: file 10 read 0 bytes
9332.655829701:7f609100d700: stream checking for file change on '/var/log/tomcat7x/fa-vm-web-expert-performance-events.log', inode 2069/2069file 7 read 0 bytes
9342.665937537:7f609100d700: stream checking for file change on '/var/log/tomcat7x/fa-vm-web-expert-all-events.log', inode 2063/2063file 8 read 0 bytes
9342.665949751:7f609100d700: stream checking for file change on '/var/log/tomcat7x/catalina-daemon.out', inode 1179/1179file 9 read 0 bytes
9342.665960655:7f609100d700: stream checking for file change on '/var/log/tomcat7x/fa-vm-web-expert-application-all-events.log', inode 2068/2068file 10 read 0 bytes

看起来rsyslog正在尝试使用旧文件句柄访问文件。如何告诉rsyslog始终通过实际文件名访问文件? 谢谢 彼得

1 个答案:

答案 0 :(得分:1)

在旋转应用程序日志文件后,向rsyslog发送HUP信号。这将强制rsyslog关闭并重新打开其文件描述符。