5

I am trying to stop Clamav service in Linux, but I am not able to do that. I have installed Clamav in a seperate directory.

When running below command:

$ systemctl stop clamav-daemon

I get this error message:

Warning: Stopping clamav-daemon.service, but it can still be activated by: clamav-daemon.socket

When running:

$ systemctl status clamav-daemon

I get:

 clamav-daemon.service - Clam AntiVirus userspace daemon
   Loaded: loaded (/usr/lib/systemd/system/clamav-daemon.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2020-04-29 13:23:33 IST; 7s ago
     Docs: man:clamd(8)
           man:clamd.conf(5)
           https://www.clamav.net/documents/
 Main PID: 32213 (clamd)
    Tasks: 1
   CGroup: /system.slice/clamav-daemon.service
           └─32213 /usr/local/sbin/clamd --foreground=true

Any help will be appreciated. Thanks.

4

1 回答 1

7

当您以普通用户身份登录时,可以通过看到命令中的 $ 符号来理解,clamav 不会停止。您需要执行以下命令。

它将仅对登录会话停止 clamav

$ sudo systemctl stop clamav-daemon

查看状态

$ sudo systemctl status clamav-daemon

它将返回:

● clamav-daemon.service - Clam AntiVirus 用户空间守护程序已加载:已加载(/lib/systemd/system/clamav-daemon.service;已禁用;供应商预设:已启用) Drop-In:/etc/systemd/system/clamav-daemon。 service.d └─extend.conf Active: inactive (dead) Docs: man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/

8 月 20 日 08:58:53 machine clamd[808]:2020 年 8 月 20 日星期四 08:58:53 -> 启用 HTML 支持。8 月 20 日 08:58:53 machine clamd[808]:2020 年 8 月 20 日星期四 08:58:53 -> 已启用 XMLDOCS 支持。8 月 20 日 08:58:53 machine clamd[808]:2020 年 8 月 20 日星期四 08:58:53 -> 启用 HWP3 支持。8 月 20 日 08:58:53 machine clamd[808]:Thu Aug 20 08:58:53 2020 -> 每 3600 秒自我检查一次。8 月 20 日 09:58:53 machine clamd[808]:2020 年 8 月 20 日星期四 09:58:53 -> SelfCheck:数据库状态正常。8 月 20 日 10:57:51 机器 systemd[1]:停止 Clam AntiVirus 用户空间守护进程... 8 月 20 日 10:57:52 机器 clamd[808]:2020 年 8 月 20 日星期四 10:57:52 -> --- 停止于2020 年 8 月 20 日星期四 10:57:52 > 8 月 20 日 10:57:52 机器 clamd[808]:2020 年 8 月 20 日星期四 10:57:52 -> 套接字文件已删除。8 月 20 日 10:57:52 机器 systemd[1]:clamav-daemon.service:成功。8 月 20 日 10:57:52 机器 systemd[1]:

如果您创建了 clamav 守护程序的符号链接以在 pc 启动时自动启动程序,那么您需要删除该链接,以便 clamav 不会自动启动

$ sudo systemctl disable clamav-daemon
于 2020-08-20T05:07:04.040 回答