zoukankan      html  css  js  c++  java
  • 重启rsyslog服务时出现问题(误删/var/log/messages解决方案)

    今天修改了/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修改的内容就会生效。

    验证了下,还真的可以。
  • 相关阅读:
    十二经络容易堵塞穴位
    考研英语词汇-乱序便携版-遗忘曲线
    分享一个硬核理工类科普节目:回到2049(12月17号取消置顶)
    191129
    191130
    191128
    191127
    191126
    191125
    微信公众号自定义菜单中添加图标(转)
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/7905265.html
Copyright © 2011-2022 走看看