#1  
Old 5th May 2009, 20:34
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
Default 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
Reply With Quote
Sponsored Links
  #2  
Old 6th May 2009, 21:18
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
Default

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

Thanks,

Jon
Reply With Quote
  #3  
Old 6th May 2009, 23:01
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

What's the output of
Code:
ls -l /var/run/clamav/clamd.sock
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 7th May 2009, 16:13
jonwatson jonwatson is offline
Senior Member
 
Join Date: Feb 2007
Posts: 176
Thanks: 15
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by falko View Post
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
Reply With Quote
  #5  
Old 7th May 2009, 17:37
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

What's the output of
Code:
ls -la /var/run/
? Maybe it's a permissions problem with one of the directories in the path...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 7th May 2009, 18:15
www www is offline
Junior Member
 
Join Date: May 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #7  
Old 13th July 2011, 19:52
egillette egillette is offline
Junior Member
 
Join Date: Jul 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #8  
Old 18th August 2011, 05:02
rgordey rgordey is offline
Junior Member
 
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by www View Post
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.
Reply With Quote
The Following User Says Thank You to rgordey For This Useful Post:
falko (18th August 2011)
  #9  
Old 18th August 2011, 19:45
egillette egillette is offline
Junior Member
 
Join Date: Jul 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default 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!
Reply With Quote
Reply

Bookmarks

Tags
clamd, email

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Monit on Debian Hans Tips/Tricks/Mods 2 6th October 2008 13:53
packet loss Chad Server Operation 2 12th June 2008 14:13
Monit & Munin SamTzu HOWTO-Related Questions 1 4th May 2008 18:03
"Too many open files in system" problems Berry Installation/Configuration 3 10th November 2007 21:58
dns server error Hellbound General 7 2nd August 2007 09:18


All times are GMT +2. The time now is 02:24.


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