clamd: エラー: ローカル: ソケットディレクトリを作成できません: /var/run/clamd.scan: 権限が拒否されました。

clamd: エラー: ローカル: ソケットディレクトリを作成できません: /var/run/clamd.scan: 権限が拒否されました。

過去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にはrootで起動してディレクトリを作成する権限が必要ですか?

事前にありがとう

ベストアンサー1

mkdir /var/run/clamd.scan

chown clamscan:clamscan /var/run/clamd.scan

systemctl restart clamd@scan

おすすめ記事