"lsof" will tell you what has it open and that should set you in the right 
direction

-----Original Message-----
From: clamav-users [mailto:clamav-users-boun...@lists.clamav.net] On Behalf Of 
David Precious via clamav-users
Sent: 03 July 2023 12:40
To: clamav-users@lists.clamav.net
Cc: David Precious
Subject: Re: [clamav-users] Assistance needed with "LOCAL: Socket file 
/var/run/clamav/clamd.ctl is in use" error in Debian Docker image

On Mon, 3 Jul 2023 11:18:47 +0000
Parmeshwar G via clamav-users <clamav-users@lists.clamav.net> wrote:
> Docker file:
> FROM debian:latest
> RUN apt-get update && \
>     apt-get install -y clamav-daemon clamav-freshclam RUN mkdir -p 
> /var/run/clamav && chown -R clamav:clamav /var/run/clamav RUN 
> freshclam CMD ["/usr/sbin/clamd"]
> 
> clamd error:
> root@2d7d8f3e55b0:/# clamd
> ERROR: Mon Jul  3 09:58:01 2023 -> LOCAL: Socket file 
> /var/run/clamav/clamd.ctl is in use by another process.

I suspect it's just because you're trying to start clamd again when it's 
already running (and thus using that socket) - it will be started by default 
once you install it, I believe - it certainly does for me.

You shouldn't need to do anything; `freshclam` should poke clamd via the socket 
if it needs to reload anything, so you should be able to omit the `CMD 
["/usr/sbin/clamd"]`.

If you want to be double certain, instead of trying to launch `clamd` directly 
like that, use the systemd service that will be created, e.g.:

`CMD ["/usr/bin/service clamav-daemon restart"]`

... or similar.


BTW, you should get `clamav-freshclam` automatically anyway if you install 
`clamav-daemon`, so you don't *need* to specify it, but it doesn't hurt to.

Also, you shouldn't have to create & chown stuff in `/var/run/clamav` - the 
Debian package should handle all that when it's installed.


_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat

Reply via email to