$ sudo logwatch

 **Unmatched Entries**
 LibClamAV Warning: **************************************************
 LibClamAV Warning: ***  The virus database is older than 7 days!  ***
 LibClamAV Warning: ***   Please update it as soon as possible.    ***
 LibClamAV Warning: **************************************************
 

え!データベースが更新されていないって!そんなばかなと思いつつ、サービスの状態を確認。

$ sudo systemctl status clamav-freshclam

× clamav-freshclam.service - ClamAV virus database updater
     Loaded: loaded (/usr/lib/systemd/system/clamav-freshclam.service; enabled; preset: 
disabled)
     Active: failed (Result: exit-code) since Sun 2025-01-12 16:06:15 JST;
 16s ago
   Duration: 59ms
 Invocation: 42b5f39455654282a4015531b1247c2b
       Docs: man:freshclam(1)
             man:freshclam.conf(5)
             https://docs.clamav.net/
    Process: 191520 ExecStart=/usr/bin/freshclam -d --foreground=true (code=e
xited, status=9)
   Main PID: 191520 (code=exited, status=9)
   Mem peak: 2.7M
        CPU: 12ms

Jan 12 16:06:15 arch systemd[1]: Started ClamAV virus database updater.
Jan 12 16:06:15 arch freshclam[191520]: ERROR: lchown to user 'clamav' failed on
Jan 12 16:06:15 arch freshclam[191520]: log file '/var/log/clamav/freshclam.log'.
Jan 12 16:06:15 arch freshclam[191520]: Error was 'No such file or directory'
Jan 12 16:06:15 arch freshclam[191520]: WARNING: lchown to user 'clamav' failed on 
log file '/var/log/clamav/freshclam.log'.  Error was 'No such file or directory'
Jan 12 16:06:15 arch freshclam[191520]: ERROR: Failed to switch to clamav user.
Jan 12 16:06:15 arch systemd[1]: clamav-freshclam.service: 
Main process exited, code=exited, status=9/n/a
Jan 12 16:06:15 arch systemd[1]: clamav-freshcl
am.service: Failed with result 'exit-code'.

いつの間にかコケていた

理由も、/var/log/clamav/freshclam.log がない、というもののようだ。

それでは。

$ sudo touch /var/log/clamav/freshclam.log

$ sudo chown clamav:clamav /var/log/clamav/freshclam.log

確認すると、

-rw-r----- 1 clamav clamav 162478 Jan 12 16:07 clamd.log
-rw-r--r-- 1 clamav clamav      0 Jan 12 16:05 freshclam.log

そのうえで、

$ sudo systemctl start clamav-freshclam

● clamav-freshclam.service - ClamAV virus database updater
     Loaded: loaded (/usr/lib/systemd/system/clamav-freshclam.service; enabled; preset: 
disabled)
     Active: active (running) since Sun 2025-01-12 16:08:25 JST; 5s ago
 Invocation: db40b54b303e40b5a93a2a1ce9e55bc5
       Docs: man:freshclam(1)
             man:freshclam.conf(5)
             https://docs.clamav.net/
   Main PID: 191768 (freshclam)
      Tasks: 1 (limit: 96161)
     Memory: 2.7M (peak: 3.1M)
        CPU: 12ms
     CGroup: /system.slice/clamav-freshclam.service
             └─191768 /usr/bin/freshclam -d --foreground=true

Jan 12 16:08:25 arch systemd[1]: Started ClamAV virus database updater.
Jan 12 16:08:25 arch freshclam[191768]: ClamAV update process started at Sun Jan 12
 16:08:25 2025
Jan 12 16:08:25 arch freshclam[191768]: daily.cld database is up-to-date (version: 
27515, sigs: 2071929, f-level: 90, builder: raynman)
Jan 12 16:08:25 arch freshclam[191768]: main.cvd database is up-to-date (version: 6
2, sigs: 6647427, f-level: 90, builder: sigmgr)
Jan 12 16:08:25 arch freshclam[191768]: bytecode.cvd database is up-to-date (versio
n: 335, sigs: 86, f-level: 90, builder: raynman)

 

Comments powered by CComment

関連記事
最も読まれた記事
クラウドタグ