LoginSignup
32
33

More than 5 years have passed since last update.

rsyslogが出力してくれなかった話(CentOS 7)

Posted at

Postfixのログが出なくて唸っていたらそれ以前の問題だった話。CentOS 7固有?

状況

Cent OS 7を載せたVPSでメールサーバ(Postfix+Dovecot)を構築しようとしていたところ、送信は上手くいくが受信が上手くいかない。ログを見ようとするも/var/log/maillogに本来出るべき情報が見当たらない。ログ出力先の設定を疑って試行錯誤するも上手くいかず、よく見ると/var/log/messagesに以下のようなログを発見した。何か失敗している。


# /var/log/messages
Dec 28 19:21:55 extentity rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="1403" x-info="http://www.rsyslog.com"] start
Dec 28 19:24:59 extentity rsyslogd-3000: sd_journal_get_cursor() failed: 'Cannot assign requested address'

postfixのログ出力

postfixの設定(/etc/postfix/main.cf, /etc/postfix/master.cf)上にログの出力先を記述する設定はなく、/etc/syslog.confまたは/etc/rsyslog.confに記述されている。


# /etc/rsyslog.conf
(略)
# Log all the mail messages in one place.
mail.*                                                  -/var/log/mail/maillog

ちょっと改変して出力先を変えているが、これでpostfixを始めとするメール関係のパッケージはすべてのログを/var/log/mail/maillogに吐き出してくれるはずだった。

対応

調べてみたところCentOS7固有の問題らしい。根本的な解決策はないが回避は可能。
Bug 1088021 - Changing a VM host's time disables rsyslog file logging

やること:
(1) /var/lib/rsyslog/imjournal.stateを削除
(2) rsyslogを再起動

これで改めてログを見ると今まで見えなかった分が吐き出されていた。ヤッタネ。ホストとVMの時刻の関係で起こるらしい。
仮想環境に載っているRHEL 7系で起こるそうなので、次のバージョンを待とう。

32
33
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
32
33