1. 程式人生 > >重啟rsyslog服務時出現問題(誤刪/var/log/messages解決方案)

重啟rsyslog服務時出現問題(誤刪/var/log/messages解決方案)

exc direct 解決 state track 出現 span article logging

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

驗證了下,還真的可以。

重啟rsyslog服務時出現問題(誤刪/var/log/messages解決方案)