重启rsyslog服务时出现问题(误删/var/log/messages解决方案)
2017-11-27 17:40
701 查看
今天修改了/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修改的内容就会生效。
验证了下,还真的可以。
于是乎就去看了下/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修改的内容就会生效。
验证了下,还真的可以。
相关文章推荐
- 重启rsyslog服务时出现问题(误删/var/log/messages解决方案)
- 重启rsyslog服务时出现问题(误删/var/log/messages解决方案)
- Win7出现无法启动无线服务,出现无线网络未连接问题的解决方案
- 发布或重启线上服务时抖动问题解决方案
- SpringCloud服务消费者第一次调用出现超时问题的解决方案
- 监控jboos并且出现问题自动重启服务
- 发布或重启线上服务时抖动问题解决方案
- 【EDAS问题】轻量级EDAS部署hsf服务出现找不到类的解决方案
- sql server agent 服务关闭后再重启出现错误的解决方案
- .NET2003安裝出现一直重启问题和SQL 2000安装出现“以前进行的程序安装创建了挂起的文件操作。运行程序之前,必须重新起动计算机。”~[解决方案]
- oracle安装出现问题解决方案和重装oracle必须删除oracle的服务项
- 当启动文档转换负载平衡器服务时出现如下问题The system cannot find the file specified的解决方案
- ORA-01033问题后又出现ORA-01145问题的解决方案
- c#通过webrequest请求远程http服务时出现的问题
- Linux 使用CDT编辑器编辑C/C++语言时出现的问题和解决方案
- 安装正版WinXP出现“缺少asms文件”问题的一个原因及解决方案
- selenium切换窗口后定位元素出现问题的解决方案
- 使用CStdioFile 读取Unicode文件时出现乱码问题解决方案
- Discuz!教程之后台安装任何插件都出现空白的问题解决方案
- 读hdfs上的文件时出现Unable to write to output stream问题的解决方案