2016年8月9日 星期二

yum install clamav-server

yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd -y

sed -i -e 's/^Example/#Example/' /etc/clamd.d/scan.conf
sed -i -e 's/^Example/#Example/' /etc/freshclam.conf
vim /etc/clamd.d/clamd.conf

User clamscan
LocalSocket /var/run/clamd.<SERVICE>/clamd.sock

freshclam
freshclam
freshclam

vim /usr/lib/systemd/system/clam-freshclam.service

# Run the freshclam as daemon
[Unit]
Description = freshclam scanner
After = network.target
[Service]
Type = forking
ExecStart = /usr/bin/freshclam -d -c 4
Restart = on-failure
PrivateTmp = true
[Install]
WantedBy=multi-user.target

systemctl enable clam-freshclam.service
systemctl start clam-freshclam.service

ls -l /usr/lib/systemd/system/clam*
mv /usr/lib/systemd/system/clamd@.service /usr/lib/systemd/system/clamd.service
vim /usr/lib/systemd/system/clamd@scan.service ->.include
/lib/systemd/system/clamd@.service -> remove @
vim /usr/lib/systemd/system/clamd.service

[Unit]
Description = clamd scanner daemon
After = syslog.target nss-lookup.target network.target
[Service]
Type = simple
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/clamd.conf --nofork=yes
Restart = on-failure
PrivateTmp = true
[Install]
WantedBy=multi-user.target

systemctl enable clamd.service
systemctl start clamd.service
systemctl enable clamd@scan.service
systemctl start clamd@scan.service

setsebool -P antivirus_can_scan_system 1
setsebool -P clamd_use_jit 1

沒有留言:

張貼留言