启动 ClamAV 守护进程时出错

Dal*_*uth 8 server clamav 14.04

我无法在我的 Ubuntu 14.04 服务器上启动 ClamAV 守护进程。这是我尝试启动服务时得到的结果:

sudo service clamav-daemon start
* Starting ClamAV daemon clamd  [fail]
Run Code Online (Sandbox Code Playgroud)

当我尝试运行clamdscan这就是我得到的

clamdscan test.jpg
ERROR: Could not lookup (null): Servname not supported for ai_socktype

----------- SCAN SUMMARY -----------
Infected files: 0
Total errors: 1
Time: 0.000 sec (0 m 0 s)
Run Code Online (Sandbox Code Playgroud)

当我clamscan在文件上运行正常时,一切都很好:

clamscan test.jpg
test.jpg: OK

----------- SCAN SUMMARY -----------
Known viruses: 3708601
Engine version: 0.98.5
Scanned directories: 0
Scanned files: 1
Infected files: 0
Data scanned: 0.18 MB
Data read: 0.18 MB (ratio 1.02:1)
Time: 9.991 sec (0 m 9 s)
Run Code Online (Sandbox Code Playgroud)

以下是我安装的与 ClamAV 相关的软件包:

> dpkg -l | grep 'clam'
ii  clamav                              0.98.5+addedllvm-0ubuntu0.14.04.1   amd64        anti-virus utility for Unix - command-line interface
ii  clamav-base                         0.98.5+addedllvm-0ubuntu0.14.04.1   all          anti-virus utility for Unix - base package
ii  clamav-daemon                       0.98.5+addedllvm-0ubuntu0.14.04.1   amd64        anti-virus utility for Unix - scanner daemon
ii  clamav-freshclam                    0.98.5+addedllvm-0ubuntu0.14.04.1   amd64        anti-virus utility for Unix - virus database update utility
ii  libclamav6                          0.98.5+addedllvm-0ubuntu0.14.04.1   amd64        anti-virus utility for Unix - library
Run Code Online (Sandbox Code Playgroud)

以下是http://paste.ubuntu.com/9544920/的内容/etc/clamav/clamd.conf

以下是http://paste.ubuntu.com/9553966/的内容ll /var/run/

Dal*_*uth 8

问题是内存使用。clamav-daemon加载所有病毒库时,显然使用了大约 300MB 的内存。我在一个带有 1GB RAM 的小型 VPS 上运行,并mysql-server-5.6占用了其中的很大一部分。为了提高性能,我添加performance_schema = off/etc/mysql/my.cnf它,减少了大约 400MB 的内存消耗!(为什么这是 5.6.6 中的新默认值?!)。无论如何,这释放了一些内存,可以clamav-daemon毫无问题地启动。


Fab*_*bby 5

我们搞定了!:-)在终端中输入下列命令Ctrl+ Alt+T

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

重新开始clamd