LoginSignup
7
5

More than 5 years have passed since last update.

logrotateで世代数が壊れる現象

Last updated at Posted at 2015-04-24

/var/log/messagesとかがなぜかすごい世代数分残る現象が発生していた。
logrotate-dオプションで設定を眺めてみたら、52世代残すことになっていた。
しかし、/var/log/messagesが設定されている/etc/logrotate.d/syslogには、世代数の設定がない。
/etc/logrotate.confでは世代数が4となっていて、52はいったいどこから来ているのかと思ったら、/etc/logrotate.d/glusterfsに原因があった。
このファイルの冒頭部分は以下のようになっていた。

# perform the log rotate every week
#
weekly
# keep the backup of 52 weeks
rotate 52
missingok

# compress the logs, but from the .2 onwards
compress
delaycompress
notifempty

# Rotate client logs
/var/log/glusterfs/*.log {

つまり、グローバルなところが汚染されているようだ。
このファイルは、/etc/logrotate.confにあるinclude /etc/logrotate.dで読み込まれるはずなので、ファイル名順でこのファイルより後ろにあるファイルが影響を受けると思われる。(未確認)

この部分は以下の修正が入っている模様。
logrotate: gluster logrotate config should not be global
なので、GlusterFS最新版を入れている場合はおそらく問題ない。

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