您的位置:首页 > 其它

重启rsyslog服务时出现问题(误删/var/log/messages解决方案)

2016-08-29 19:18 337 查看
今天修改了/etc/rsyslog.conf中的内容后,想着要通过systemctl restart rsyslog重启服务,但是执行完命令后,总感觉/etc/rsyslog.conf中修改的内容没有生效。

于是乎就去看了下/var/log/messages下的日志文件,发现有这样一行提示:Mar 1 21:33:39 localhost rsyslogd-2027: imjournal: fscanf on state file `/var/lib/rsyslog/imjournal.state' failed

接着将这行提示放到网上搜索了一番终于找到一篇解答,地址如下:
http://unix.stackexchange.com/questions/124942/rsyslog-not-logging
注意到这篇有这样几行:

When this issue occurs, you can delete /var/lib/rsyslog/imjournal.state and restart the daemon as a workaround.

rsyslog doesn't handle the date directly but only through the systemd API. I've checked the code in imjournal a while ago and this looks like an issue in systemd.

意思是说把/var/lib/rsyslog/imjournal.state文件删掉,然后在执行systemctl restart rsyslog命令,这样/etc/rsyslog.conf修改的内容就会生效。

验证了下,还真的可以。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐