経緯
仕事でちょくちょくサーバ構築を行っているが、rsyslogの設定の一部に(多分RHEL7.4系から?)警告(warn)が出るようになっていたのでメモ
環境
- OSはRHEL7.4系
事象
rsyslogの設定について、「とりあえずpriority='emerg'ならオンラインの全ユーザに通知する」を設定するため、以下を/etc/rsyslog.confに記述したところ、変な警告が出てきた。
## <facility名>.<priority> <action> のフォーマットで記述する
*.emerg *
出てきた警告は以下。
# systemctl status rsyslog -l
● rsyslog.service - System Logging Service
Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
Active: active (running) since 金 2017-12-22 01:04:58 JST; 32s ago
Docs: man:rsyslogd(8)
http://www.rsyslog.com/doc/
Main PID: 2593 (rsyslogd)
CGroup: /system.slice/rsyslog.service
mq2593 /usr/sbin/rsyslogd -n
12月 22 01:04:58 [host名] systemd[1]: Starting System Logging Service...
12月 22 01:04:58 [host名] rsyslogd[2593]: [origin software="rsyslogd" swVersion="8.24.0" x-pid="2593" x-info="http://www.rsyslog.com"] start
12月 22 01:04:58 [host名] rsyslogd[2593]: action '*' treated as ':omusrmsg:*' - please use ':omusrmsg:*' syntax instead, '*' will not be supported in the future [v8.24.0 try http://www.rsyslog.com/e/2184 ]
12月 22 01:04:58 [host名] systemd[1]: Started System Logging Service.
12月 22 01:04:58 [host名] rsyslogd[2593]: error during parsing file /etc/rsyslog.conf, on or before line 57: warnings occured in file '/etc/rsyslog.conf' around line 57 [v8.24.0 try http://www.rsyslog.com/e/2207 ]
なんか最後の行見ると構文エラーちっくな事が書いてあるな…と思いふと上数行を見ると、気になる一文が。
action '*' treated as ':omusrmsg:*' - please use ':omusrmsg:*' syntax instead, '*' will not be supported in the future
actionに'*'を使うのは将来未サポートになるから'omusrmsg:*'という記述にしてくれ、とのこと。
対応
素直に言われたとおりにaction部分の'*'を'omusrmsg:*'に変更したところ、警告が出なくなった。あっさり。
omusrmsgとは?
「User Message Output Module」の略(多分)で、ログイン中ユーザのコンソールに通知を行うためのビルトインモジュールらしい。
ユーザを指定するactionを定義する場合は、omusrmsg:の後にユーザ名を指定するかアスタリスクを指定する必要がある。
# root,user1,user2のコンソール画面に出力する
:omusrmsg:root,user1,user2
補足
いつからこの仕様になったのかは正直良く調べていないが今のところは'*'のままでも警告が出るだけで動きはする
- 上記の出力結果でも一応active(running)となっており、rsyslog自体は動いているっぽい