2017-08-31 65 views
0

我在CentOS 7.3中安裝了ClamAV,並在啓動clamd作爲systemd服務時遇到問題。由於系統服務失敗而啓動clamav

當我從命令行(/usr/sbin/clamd -c /etc/clamd.conf)手動啓動clamd時,一切都很順利,我可以使用clamdscan進行連接。

當我通過systemd啓動clamd的,(systemctl start clamd),clamd的 開始,幾秒鐘後,在日誌文件「的所有線程完成等待 」消息終止。

有沒有人有任何想法爲什麼clamd從命令行啓動OK,但不是 作爲服務?配置和日誌文件如下。謝謝。

/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 ... 

回答

0

我搞砸了安裝和錯過安裝,其中包括clamav-server-systemd軟件包。

現在工作正常。