HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   Clamd Will Not Start (http://www.howtoforge.com/forums/showthread.php?t=34559)

jonwatson 5th May 2009 20:34

Clamd Will Not Start
 
Hi All,

This morning we started seeing this in the headers of our emails:

Code:

X-Virus-Status: Failed
X-Virus-Report: /usr/bin/clamdscan error 2
X-Virus-Checker-Version: clamassassin 1.2.4 with clamdscan / ERROR: Can't connect to clamd: No such file or directory

Attempts to manually start clamd result in this

Code:

# service clamd start
Starting Clam AntiVirus Daemon: ERROR: LOCAL: Socket file unix:/var/run/clamav/clamd.sock could not be bound: No such file or directory
ERROR: Can't unlink the socket file unix:/var/run/clamav/clamd.sock

What is responsible for creating the socket and how do I make it do so?

Thanks

Jon

jonwatson 6th May 2009 21:18

Anyone have any ideas at all on this? We're running without Anti Virus until this has been sorted.

Thanks,

Jon

falko 6th May 2009 23:01

What's the output of
Code:

ls -l /var/run/clamav/clamd.sock
?

jonwatson 7th May 2009 16:13

Quote:

Originally Posted by falko (Post 186613)
What's the output of
Code:

ls -l /var/run/clamav/clamd.sock
?

That's the problem, there is no such file.

I tried touching it to create the file, which worked, but evidently wasn't enough for ClamAV to work.

I have since rebooted the machine and all it well now. I just hate having to do that because it is production so we have to wait until after hours to do it and that means everyone is running without AV all day long.

If there's some way to create the clamd.sock file properly if it is not being created, I would prefer to do that over rebooting.

Thanks

Jon

falko 7th May 2009 17:37

What's the output of
Code:

ls -la /var/run/
? Maybe it's a permissions problem with one of the directories in the path...

www 7th May 2009 18:15

I had the same problem. Commenting out
Code:

LocalSocket unix:/var/run/clamav/clamd.sock
and
Code:

FixStaleSocket yes
in /etc/clamd.conf allowed clamd to restart.

Then I noticed that there was a new version of clamd available through yum. Installing that seems to have fixed the problem and clamd now restarts even with the lines above uncommented.

egillette 13th July 2011 19:52

Worked for me. . .
 
Hey, I hate to open an old thread, but I just wanted to say thanks!

I was having the same issue with clamd on a client's machine, and for whatever reason -- even after an upgrade it still kept giving me the socket permission denied error message.

I checked the permissions on the file and on the directory and everything seemed to be fine, but still I got the error message.

Commenting out the two lines mentioned above allowed clamd to start without a hitch!

Code:

root@server [/var]# service clamd start
Starting Clam AntiVirus Daemon: Bytecode: Security mode set to "TrustSigned".
ERROR: LOCAL: Socket file /var/clamd could not be removed: Permission denied
ERROR: Can't unlink the socket file /var/clamd
                                                          [FAILED]
root@server [/var]# nano /etc/clamd.conf
root@server [/var]# service clamd start
Starting Clam AntiVirus Daemon: Bytecode: Security mode set to "TrustSigned".
                                                          [  OK  ]
root@server [/var]#

So I'm happy! :)

- Eric Gillette

rgordey 18th August 2011 05:02

Quote:

Originally Posted by www (Post 186879)
I had the same problem. Commenting out
Code:

LocalSocket unix:/var/run/clamav/clamd.sock
and
Code:

FixStaleSocket yes
in /etc/clamd.conf allowed clamd to restart.

Then I noticed that there was a new version of clamd available through yum. Installing that seems to have fixed the problem and clamd now restarts even with the lines above uncommented.

I don't want to be a wet blanket, but you haven't fixed the problem, you've ignored it. What you did was to turn off the socket by which 99% of local programs will submit data to be scanned for viruses by clamav. To be perfectly honest, while it is possible to configure clamav to accept submissions via tcp that's not too popular right now.

Clamav was complaining that either /var/run/clamd/clamd.sock (the bolded directory) didn't exist or it had no rights to read/create/modify etc. in that directory.

Solution:
#mkdir /var/run/clamd
#chown root:<same group name that clamd runs as> /var/run/clamd

You also might want to un-comment those two lines in clamd.conf.

egillette 18th August 2011 19:45

An Upgrade Resolved The Issue. . .
 
Well, after upgrading ClamAV, clamd now starts fine even with the lines uncommented for the socket.

So problem was apparently resolved on their end, and as quickly as it started, it's now finished just as quickly!


All times are GMT +2. The time now is 09:54.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.