由于 systemd 服务启动 clamav 失败

问题描述 投票:0回答:1

我已在

ClamAV
中安装了
CentOS 7.3
,并且在将
clamd
作为 systemd 服务启动时遇到问题。

当我从命令行手动启动 clamd (

/usr/sbin/clamd -c /etc/clamd.conf
) 时,一切顺利,我可以使用 clamdscan 进行连接。

当我通过systemd启动clamd时,(

systemctl start clamd
),clamd 启动,几秒钟后终止,并显示消息“正在等待” 让所有线程在日志文件中完成。

有谁知道为什么 clamd 从命令行启动正常但不行 作为服务?配置和日志文件如下。谢谢你。

/usr/lib/systemd/system/clamd.service:

[Unit]
Description = clamd scanner daemon
After = network.target

[Service]
ExecStart = /usr/sbin/clamd -c /etc/clamd.conf
PrivateTmp = true

[Install]
WantedBy=multi-user.target

/etc/clamd.conf:

LogFile /tmp/clamd.log
LogTime true
LogVerbose true
TCPSocket 3310
TCPAddr localhost

日志文件:

Thu Aug 31 09:52:18 2017 -> +++ Started at Thu Aug 31 09:52:18 2017
Thu Aug 31 09:52:18 2017 -> Received 0 file descriptor(s) from systemd
Thu Aug 31 09:52:18 2017 -> clamd daemon 0.99.2 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Thu Aug 31 09:52:18 2017 -> Log file size limited to 1048576 bytes.
Thu Aug 31 09:52:18 2017 -> Reading databases from /var/lib/clamav
Thu Aug 31 09:52:18 2017 -> Not loading PUA signatures.
Thu Aug 31 09:52:18 2017 -> Bytecode: Security mode set to "TrustSigned".
Thu Aug 31 09:52:24 2017 -> Loaded 6303399 signatures.
Thu Aug 31 09:52:26 2017 -> TCP: Bound to [127.0.0.1]:3310
Thu Aug 31 09:52:26 2017 -> TCP: Stting connection queue length to 200
Thu Aug 31 09:52:26 2017 -> Limits: Global size limit set to 104857600 bytes.
Thu Aug 31 09:52:26 2017 -> Limits: File size limit set to 26214400 bytes.
Thu Aug 31 09:52:26 2017 -> Limits: Recursion level limit set to 16.
Thu Aug 31 09:52:26 2017 -> Limits: Files limit set to 10000.
Thu Aug 31 09:52:26 2017 -> Limits: Core-dump limit is 0.
Thu Aug 31 09:52:26 2017 -> Limits: MaxEmbeddedPE limit set to 10485760 bytes.
Thu Aug 31 09:52:26 2017 -> Limits: MaxHTMLNormalize limit set to 10485760 bytes.
Thu Aug 31 09:52:26 2017 -> Limits: MaxHTMLNoTags limit set to 2097152 bytes.
Thu Aug 31 09:52:26 2017 -> Limits: MaxScriptNormalize limit set to 5242880 bytes.
Thu Aug 31 09:52:26 2017 -> Limits: MaxZipTypeRcg limit set to 1048576 bytes.
Thu Aug 31 09:52:26 2017 -> Limits: MaxPartitions limit set to 50.
Thu Aug 31 09:52:26 2017 -> Limits: MaxIconsPE limit set to 100.
Thu Aug 31 09:52:26 2017 -> Limits: MaxRecHWP3 limit set to 16.
Thu Aug 31 09:52:26 2017 -> Limits: PCREMatchLimit limit set to 10000.
Thu Aug 31 09:52:26 2017 -> Limits: PCRERecMatchLimit set to 5000.
Thu Aug 31 09:52:26 2017 -> Limits: PCREMaxFileSize limit set to 26214400.
Thu Aug 31 09:52:26 2017 -> Archive support enabled.
Thu Aug 31 09:52:26 2017 -> Algorithmic detection enabled.
Thu Aug 31 09:52:26 2017 -> Portable Executable support enabled.
Thu Aug 31 09:52:26 2017 -> ELF support enabled.
Thu Aug 31 09:52:26 2017 -> Mail files support enabled.
Thu Aug 31 09:52:26 2017 -> OLE2 support enabled.
Thu Aug 31 09:52:26 2017 -> PDF support enabled.
Thu Aug 31 09:52:26 2017 -> SWF support enabled.
Thu Aug 31 09:52:26 2017 -> HTML support enabled.
Thu Aug 31 09:52:26 2017 -> XMLDOCS support enabled.
Thu Aug 31 09:52:26 2017 -> HWP3 support enabled.
Thu Aug 31 09:52:26 2017 -> Self checking every 600 seconds.
Thu Aug 31 09:52:26 2017 -> Listening daemon: PID: 5518
Thu Aug 31 09:52:26 2017 -> MaxQueue set to: 100
Thu Aug 31 09:52:28 2017 -> Waiting for all threads to finish.
Thu Aug 31 09:52:29 2017 -> Shutting down the main socket.
Thu Aug 31 09:52:29 2017 -> --- Stopped at Thu Aug 31 09:52:29 2017
Thu Aug 31 09:52:29 2017 -> Closing the main socket

systemctl 状态命令

clamd.service - clamd scanner daemon
Loaded: loaded (/usr/lib/systemd/system/clamd.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Thu 2017-08-31 09:52:29 UTC; 42 min ago
Main PID: 5516 (code=exited, status=0/SUCCESS)

Aug 31 09:52:18 localhost.localdomain systemd[1]: Started clamd scanner daemon.
Aug 31 09:52:18 localhost.localdomain systemd[1]: Starting clamd scanner daemon ...
centos7 systemd clam
1个回答
0
投票

我在安装过程中搞砸了,错过了安装 clamav-server-systemd 软件包等。

现在可以正常工作了。

© www.soinside.com 2019 - 2024. All rights reserved.