vCenter 8.0.3 でログローテーションが期待通りに機能しない
search cancel

vCenter 8.0.3 でログローテーションが期待通りに機能しない

book

Article ID: 440348

calendar_today

Updated On:

Products

VMware vCenter Server 8.0

Issue/Introduction

免責事項: これは英文の記事「Log Rotate service not working as expected in vCenter 8.0.3」の日本語訳です。記事はベストエフォートで翻訳を進めているため、ローカライズ化コンテンツは最新情報ではない可能性があります。最新情報は英語版の記事で参照してください。

サードパーティの監視ツールから、ログローテーションサービスが実行されていないというアラートを受信します。

 

サービスのステータスを確認すると、以下の出力が得られます。 

 

systemctl status logrotate.service
● logrotate.service - Rotate log files
     Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static)
     Active: inactive (dead) since DAY ####-##-## ##:##:## UTC; #h ago

 

journalctl -u logrotate コマンドでは以下の出力が得られます。

Date VCSA-FQDN systemd[1]: Starting Rotate log files...
Date VCSA-FQDN logrotate[#######]: error: state file /var/lib/logrotate.status is already locked
Date VCSA-FQDN logrotate[#######]: logrotate does not support parallel execution on the same set of logfiles.
Date VCSA-FQDN systemd[1]: logrotate.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Date VCSA-FQDN systemd[1]: logrotate.service: Failed with result 'exit-code'.
Date VCSA-FQDN systemd[1]: Failed to start Rotate log files.

 

Environment

VMware vCenter Server 8.0.3

Cause

vCenter Server 8.0u3 以降では、2 つの logrotate インスタンスが実行されています:


1. systemd -> logrotate.timer -> logrotate.service
2. crond -> logrotate.service

以前のバージョンでは、cron のみが使用されていました。両方のインスタンスは 1 時間間隔で実行されます。ロックを取得したプロセスは処理を続行し、もう一方は以下のエラーで失敗します:


... state file /var/lib/logrotate.status is already locked
... logrotate does not support parallel execution on the same set of logfiles.

これは想定どおりの動作です。無視して問題ありません。

Resolution

本事象は vCenter 9.x で修正される予定です。以下のコマンドを使用してサービスを無効にすることができます。 

systemctl stop logrotate.timer
systemctl disable logrotate.timer
systemctl stop logrotate.service