
OpenSUSE 11.4でmunin 1.4.5を使用しています。最近、一部の権限の問題を解決するためにlogrotateを更新した後、苦情が発生しました。
Mar 3 12:15:05 lucien logrotate: error: "/var/log/munin" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.
Mar 3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-html.log: Bad file descriptor
Mar 3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-limits.log: Bad file descriptor
Mar 3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-update.log: Bad file descriptor
Mar 3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-graph.log: Bad file descriptor
Mar 3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-node.log: Bad file descriptor
su
だから、次のガイドラインを追加しました。/etc/logrotate.d/munin
/etc/logrotate.d/munin-node
/var/log/munin/munin-html.log
/var/log/munin/munin-nagios.log
/var/log/munin/munin-limits.log
/var/log/munin/munin-update.log {
su munin munin
daily
missingok
rotate 7
compress
copytruncate
notifempty
create 640 munin munin
}
/var/log/munin/munin-graph.log {
su munin www
daily
missingok
rotate 7
compress
copytruncate
notifempty
create 660 munin www
}
/var/log/munin/munin-cgi-graph.log {
su wwwrun munin
daily
missingok
rotate 7
compress
copytruncate
notifempty
create 640 wwwrun www
}
/var/log/munin/munin-node.log {
su munin munin
daily
missingok
rotate 7
compress
copytruncate
notifempty
create 640 munin munin
}
今logrotateはもはや回転しません。
Mar 5 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-html.log: Bad file descriptor
Mar 5 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-limits.log: Bad file descriptor
Mar 5 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-update.log: Bad file descriptor
Mar 5 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-graph.log: Bad file descriptor
Mar 5 12:15:05 lucien logrotate: error: error setting owner of /var/log/munin/munin-cgi-graph.log-20120305: Operation not permitted
Mar 5 12:15:05 lucien logrotate: error: error opening /var/log/munin/munin-node.log: Permission denied
ls -la
の一つ/var/log/munin/
はここ。
muninと再び動作するようにlogrotateを取得するにはどうすればよいですか?
答え1
あなたの権限が混乱しています/var/log/muninそして設定ファイルにあります。ファイルには異なるユーザー/グループのペアがあり、構成にも異なるグループ/ペアがあります。
問題を解決するための2つのオプションがあります
- デフォルトルートの使用:root権限
- で指定みんな同じユーザー/グループのペアに対するmuninルール
まず、chownを使用して権限を再帰的にリセットできます。
chown -R USER:GROUP /var/log/munin
su ...
次に、2番目の回避策を選択した場合は、すべての行を次の行に置き換える必要があります。
su USER GROUP
最初の回避策を選択した場合は、すべての行を完全に削除する必要がありますsu ...
。
答え2
"-d" (デバッグ) を使って root として手動で logrotate を実行すると、クールなダイアログ出力が表示されます。
答え3
これは次のようなことがわかりました。抜け穴logrotate-3.7.9-6.9.1
で導入され修正されましたlogrotate-3.7.9-6.12.1
。