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

    验证了下,还真的可以。
  • 相关阅读:
    谷歌眼镜--参考文档
    谷歌眼镜--与菜单项互动
    谷歌眼镜--UI指南
    【cl】工程导入
    Ylmf_Ghost_Win7_SP1_x64_2017_0113.iso虚拟机安装
    win7_64
    linux下安装jdk
    rar x 解压rar文件,提示permission denied
    linux下安装rar解压包
    Red Hat Linux虚拟机与主机共享文件
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/7905265.html
Copyright © 2011-2022 走看看