LoginSignup
0
0

More than 3 years have passed since last update.

【備忘録】rsyslogの出力が止まった時の対応

Posted at

環境

CentOS Linux release 7.3.1611 (Core)
systemd 219
rsyslog 7.4.7-16.el7

事象

rsyslogによるログ出力が一部止まった。

やったこと

rsyslogをデバッグ実行すると下記が出力されていた。


/usr/sbin/rsyslogd -n -d

 7204.120717564:7fc48c3df780: Called LogError, msg: warning: ~ action is deprecated, consider using the 'stop' statement instead

/etc/rsyslog.d/21-cloudinit.confに~が書かれていることが問題らしいので、修正した。

(変更前)


# comment out the following line to allow CLOUDINIT messages through.
# Doing so means you'll also get CLOUDINIT messages in /var/log/syslog
& ~

(変更後)

# comment out the following line to allow CLOUDINIT messages through.
# Doing so means you'll also get CLOUDINIT messages in /var/log/syslog
& stop

状況変わらず。
/var/log/messagesを見るとjournaldがなんか駄目になっているっぽい

systemd: Starting Cleanup of Temporary Directories...
systemd-tmpfiles: [/usr/lib/tmpfiles.d/systemd.conf:26] Failed to replace specifiers: /run/log/journal/%m
systemd-tmpfiles: [/usr/lib/tmpfiles.d/systemd.conf:28] Failed to replace specifiers: /run/log/journal/%m
systemd-tmpfiles: [/usr/lib/tmpfiles.d/systemd.conf:29] Failed to replace specifiers: /run/log/journal/%m
systemd-tmpfiles: [/usr/lib/tmpfiles.d/systemd.conf:32] Failed to replace specifiers: /var/log/journal/%m
systemd-tmpfiles: [/usr/lib/tmpfiles.d/systemd.conf:34] Failed to replace specifiers: /var/log/journal/%m
systemd-tmpfiles: [/usr/lib/tmpfiles.d/systemd.conf:35] Failed to replace specifiers: /var/log/journal/%m
systemd: systemd-tmpfiles-clean.service: main process exited, code=exited, status=1/FAILURE
systemd: Failed to start Cleanup of Temporary Directories.
systemd: Unit systemd-tmpfiles-clean.service entered failed state.
systemd: systemd-tmpfiles-clean.service failed.

試しにjournaldを再起動してみると、起動しなくなった。。。
systemdでなくコマンドで起動してみると下記が出力された。


/usr/lib/systemd/systemd-journald
 Failed to get machine id: No such file or directory

machine idなんて知らんので、調べてみると/etc/machine-idというファイルが原因らしい。
なので、systemd-machine-id-setup実行しサーバrebootを実行。

直った。

感想

サーバはVMコピーで用意してもらったものなので、ここまで不具合があるものかと思いつつ、
知らないことが多々あったので面白かった。
結局何が根本原因だったのかはこれから調べる予定。

0
0
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
0
0