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

    验证了下,还真的可以。
  • 相关阅读:
    数据源与连接池
    JavaBean
    JSP隐含对象
    kibana 报错 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed
    JS中key-value存取
    JS判断数组中是否包含某个值
    数据库的事务
    net 查看版本号
    同行右边浮动
    CodeFirst
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/7905265.html
Copyright © 2011-2022 走看看