[clamav-users] Clamd Socket Occupied

Colony.three colony.three at protonmail.ch
Tue Dec 5 07:13:22 UTC 2017


As Red Hat hasn't solved the problem of unix:sockets, I had to make my own systemd files.  But there's a little problem.

clamd.socket
==========================================================
[Unit]
Description=Socket for Clam AntiVirus userspace daemon
Documentation=man:clamd(8) man:clamd.conf(5) http://www.clamav.net/lang/en/doc/

[Socket]
ListenStream=/run/clamav/clamd.sock
#ListenStream=127.0.0.1:1024
SocketUser=clamilt
SocketGroup=clamilt
RemoveOnStop=True

[Install]
WantedBy=sockets.target
==========================================================

clamd.service
==========================================================
[Unit]
Description = clamd scanner daemon
After = syslog.target nss-lookup.target network.target
Requires=clamd.socket

[Service]
Type=forking
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/scan.conf --foreground=no
Nice = 5
Restart = on-failure
PrivateTmp = true

[Install]
WantedBy=multi-user.target
Also=clamd.socket
==========================================================

Now I find that after enabling/starting clamd.socket, clamd.service is not starting.  And in /var/log/maillog is:

Tue Dec  5 07:10:43 2017 -> +++ Started at Tue Dec  5 07:10:43 2017
Tue Dec  5 07:10:43 2017 -> Received 0 file descriptor(s) from systemd.
Tue Dec  5 07:10:43 2017 -> clamd daemon 0.99.2 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Tue Dec  5 07:10:43 2017 -> Log file size limited to 2097152 bytes.
Tue Dec  5 07:10:43 2017 -> Reading databases from /var/lib/clamav
Tue Dec  5 07:10:43 2017 -> Not loading PUA signatures.
Tue Dec  5 07:10:43 2017 -> Bytecode: Security mode set to "TrustSigned".
Tue Dec  5 07:10:52 2017 -> Loaded 6356732 signatures.
Tue Dec  5 07:10:55 2017 -> ERROR: LOCAL: Socket file /run/clamav/clamd.sock is in use by another process.

Huh?  It's in use by its own .socket.  The .socket runs fine, and when I stop it /run/clamav/clamd.sock goes away like it should.  Permissions are fine, and selinux is Permissive.

Any ideas?


More information about the clamav-users mailing list