ClamAV:未在 ubuntu 上创建 clamd.ctl 文件

Nik*_*ppa 6 updates configuration apt clamav 16.04

我有 ubuntu 16.04.6 版本,我正在尝试安装并运行clamdscan它以检查防病毒软件。

我使用了他们网站中给出安装说明。IE。

sudo apt-get install clamav
sudo apt-get install clamav-daemon
Run Code Online (Sandbox Code Playgroud)

以上 2 个命令工作正常。但是当我尝试通过运行命令下载定义(我假设在上述之后是强制性的)时

sudo freshclam
Run Code Online (Sandbox Code Playgroud)

它未能引发以下错误:

^Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.ctl: No such file or directory
Run Code Online (Sandbox Code Playgroud)

根据这个接受的答案,安装后应该创建该文件,clamav-daemon但显然这不会发生。

小智 7

我在Ubuntu 20.04 LTS机器上遇到了这个问题,

我所做的是:

  1. sudo systemctl stop clamav-daemon.service
  2. 然后运行sudo rm /var/log/clamav/freshclam.log(有时它会被锁定)
  3. 启动服务 sudo systemctl start clamav-daemon.service

以确保一切正常运行sudo systemctl status clamav-daemon.service,输出应如下所示:

?  ~ sudo systemctl status clamav-daemon.service
? clamav-daemon.service - Clam AntiVirus userspace daemon
     Loaded: loaded (/lib/systemd/system/clamav-daemon.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/clamav-daemon.service.d
             ??extend.conf
     Active: active (running) since Sun 2020-05-03 05:03:51 EEST; 4s ago
       Docs: man:clamd(8)
             man:clamd.conf(5)
             https://www.clamav.net/documents/
    Process: 6122 ExecStartPre=/bin/mkdir -p /run/clamav (code=exited, status=0/SUCCESS)
    Process: 6124 ExecStartPre=/bin/chown clamav /run/clamav (code=exited, status=0/SUCCESS)
   Main PID: 6138 (clamd)
      Tasks: 1 (limit: 14203)
     Memory: 367.3M
     CGroup: /system.slice/clamav-daemon.service
             ??6138 /usr/sbin/clamd --foreground=true

May 03 05:03:51 user systemd[1]: Starting Clam AntiVirus userspace daemon...
May 03 05:03:51 user systemd[1]: Started Clam AntiVirus userspace daemon.
Run Code Online (Sandbox Code Playgroud)

现在运行sudo freshclam并检查日志文件(或控制台输出)

Sun May  3 05:04:02 2020 -> --------------------------------------
Sun May  3 05:04:02 2020 -> ClamAV update process started at Sun May  3 05:04:02 2020
Sun May  3 05:04:02 2020 -> daily.cvd database is up to date (version: 25800, sigs: 2331970, f-level: 63, builder: raynman)
Sun May  3 05:04:02 2020 -> main.cvd database is up to date (version: 59, sigs: 4564902, f-level: 60, builder: sigmgr)
Sun May  3 05:04:02 2020 -> bytecode.cvd database is up to date (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Run Code Online (Sandbox Code Playgroud)

享受!


小智 4

我发现运行后:

freshclam 
Run Code Online (Sandbox Code Playgroud)

并得到这个错误:

Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.ctl: No such file or directory
Run Code Online (Sandbox Code Playgroud)

你只需要为恶魔运行重启:

service clamav-daemon restart
Run Code Online (Sandbox Code Playgroud)

然后freshclam 再一次,一切正常。


JoK*_*KeR 2

为 ClamAV 添加 sock 文件:

sudo touch /var/lib/clamav/clamd.sock
sudo chown clamav:clamav /var/lib/clamav/clamd.sock
Run Code Online (Sandbox Code Playgroud)

然后,编辑/etc/clamav/clamd.conf- 取消注释此行:

LocalSocket /var/lib/clamav/clamd.sock
Run Code Online (Sandbox Code Playgroud)

保存文件并重新启动clamav-daemon.service

另一个错误:

sudo freshclam

Downloading daily-25578.cdiff [100%]
Downloading daily-25579.cdiff [100%]
Downloading daily-25580.cdiff [100%]
Downloading daily-25581.cdiff [100%]
Downloading daily-25582.cdiff [100%]
Downloading daily-25583.cdiff [100%]
daily.cld updated (version: 25583, sigs: 1778105, f-level: 63, builder: raynman)
Downloading bytecode-331.cdiff [100%]
bytecode.cld updated (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Database updated (6344448 signatures) from database.clamav.net (IP: 104.16.219.84)
WARNING: Clamd was NOT notified: Can't connect to clamd through /run/clamav/clamd.ctl: No such file or directory
Run Code Online (Sandbox Code Playgroud)

蛤

为 ClamAV 添加 sock 文件:

sudo touch /run/clamav/clamd.sock
sudo chown clamav:clamav /run/clamav/clamd.sock

sudo systemctl restart clamav-daemon.service
sudo freshclam

ClamAV update process started at Thu Sep 26 11:47:12 2019
main.cvd is up to date (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
daily.cld is up to date (version: 25583, sigs: 1778105, f-level: 63, builder: raynman)
bytecode.cld is up to date (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Run Code Online (Sandbox Code Playgroud)

就是这样。