지난 13일 동안(저는 본업을 하고 있습니다.) Centos 7의 깨끗한 이미지에 더 이상 ClamAV를 설치할 수 없는 것 같습니다.
/var/log/메시지
Sep 16 14:54:52 ip-172-31-42-25 systemd: Starting clamd scanner (scan) daemon...
Sep 16 14:54:52 ip-172-31-42-25 clamd[25456]: Received 0 file descriptor(s) from systemd.
Sep 16 14:54:52 ip-172-31-42-25 clamd[25456]: clamd daemon 0.103.3 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Sep 16 14:54:52 ip-172-31-42-25 clamd[25456]: Log file size limited to 1048576 bytes.
Sep 16 14:54:52 ip-172-31-42-25 clamd[25456]: Reading databases from /var/lib/clamav
Sep 16 14:54:52 ip-172-31-42-25 clamd[25456]: Not loading PUA signatures.
Sep 16 14:54:52 ip-172-31-42-25 clamd[25456]: Bytecode: Security mode set to "TrustSigned".
Sep 16 14:55:07 ip-172-31-42-25 clamd[25456]: Loaded 8565181 signatures.
Sep 16 14:55:10 ip-172-31-42-25 clamd[25456]: LOCAL: Could not create socket directory: /var/run/clamd.scan: Permission denied
Sep 16 14:55:10 ip-172-31-42-25 clamd: ERROR: LOCAL: Could not create socket directory: /var/run/clamd.scan: Permission denied
Sep 16 14:55:10 ip-172-31-42-25 clamd: ERROR: LOCAL: Socket file /var/run/clamd.scan/clamd.sock could not be bound: No such file or directory
Sep 16 14:55:10 ip-172-31-42-25 clamd[25456]: LOCAL: Socket file /var/run/clamd.scan/clamd.sock could not be bound: No such file or directory
Sep 16 14:55:10 ip-172-31-42-25 systemd: [email protected]: control process exited, code=exited status=1
Sep 16 14:55:10 ip-172-31-42-25 systemd: Failed to start clamd scanner (scan) daemon.
Sep 16 14:55:10 ip-172-31-42-25 systemd: Unit [email protected] entered failed state.
Sep 16 14:55:10 ip-172-31-42-25 systemd: [email protected] failed.
Sep 16 14:55:10 ip-172-31-42-25 systemd: [email protected] holdoff time over, scheduling restart.
목차
ls -la /var/run
lrwxrwxrwx. 1 root root 6 Oct 30 2020 /var/run -> ../run
ls -la /var/run/
total 36
drwxr-xr-x. 26 root root 800 Sep 16 12:02 .
운영 체제
cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
내가 아는 한 SELinux는 아무것도 차단하지 않습니다.
[root@ip-172-31-42-25 centos]# audit2allow -a -w
[root@ip-172-31-42-25 centos]#
이제 이것은 CI/CD의 일부이므로 미리 디렉터리를 생성하는 단계를 추가할 수 있다고 생각했습니다. 하지만 이것이 올바른 해결책일까요?
보시다시피 clam은 루트로 시작하고 디렉터리를 생성할 수 있는 권한이 있어야 합니까?
미리 감사드립니다
답변1
mkdir /var/run/clamd.scan
chown clamscan:clamscan /var/run/clamd.scan
systemctl restart clamd@scan