freshclamコマンドを実行したら「ERROR: /var/log/clamav/freshclam.log is locked by another process」のエラーが表示された

ショコラ
ショコラ

freshclamコマンドを実行したら「ERROR: /var/log/clamav/freshclam.log is locked by another process」のエラーが表示された

freshclamデーモンが動いているのが原因。

もっさん先輩
もっさん先輩

シチュエーション

freshclamコマンドを実行して、ウイルス定義を最新のものに更新しようとしたところ以下のエラーが表示された。
これは freshclamデーモンがファイルを握っているのが原因。

freshclamデーモンが起動していれば手動で freshclamコマンドを実行する必要はありません。

# freshclam
ERROR: /var/log/clamav/freshclam.log is locked by another process
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
ERROR: initialize: libfreshclam init failed.
ERROR: Initialization error!

freshclamデーモンが起動しているか確認します。

systemctl status clamav-freshclam
# systemctl status clamav-freshclam
 clamav-freshclam.service - ClamAV virus database updater

freshclamデーモンを止めれば手動アップデートすることはできます。

systemctl stop clamav-freshclam
freshclam
# freshclam
Sun Jul 24 07:35:24 2022 -> ClamAV update process started at Sun Jul 24 07:35:24 2022
Sun Jul 24 07:35:24 2022 -> daily.cvd database is up-to-date (version: 26610, sigs: 1991320, f-level: 90, builder: raynman)
Sun Jul 24 07:35:24 2022 -> main.cvd database is up-to-date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)
Sun Jul 24 07:35:24 2022 -> bytecode.cvd database is up-to-date (version: 333, sigs: 92, f-level: 63, builder: awillia2)

以上

Scroll to Top