The Disc Shop wrote:
> [EMAIL PROTECTED] wrote:
> clamdscan --config-file=/usr/local/etc/clamd.conf abc
> /var/spool/virtual/thediscshop.com.au/accounts: Access denied. ERROR

Well, that's easy.  The clamd user doesn't have permission to the file you're 
trying to scan.  Make sure to give the clamd user read access on a file before 
you try to scan it.
 
> ----------- SCAN SUMMARY -----------
> Infected files: 0
> Time: 0.000 sec (0 m 0 s)
> 
> Note: Both commands were run as root

clamdscan may have been run as root, but clamdscan doesn't have to read the 
file.  It just passes the file NAME to clamd, which does not run as root.
 
> I also just checked the clamd.log and it had the following
> 
> WARNING: Socket file /tmp/clamd exists. Unclean shutdown? Removing...
> ERROR: Socket file /tmp/clamd could not be removed: Operation not
> permitted 

That points to a failed shutdown.
 
> so i manually removed it
> 
> but now I get this
> ERROR: Can't save PID in file /var/run/clamd.pid

This is probably the reason for the failed shutdown.  Either give the clamd 
user write access to /var/run (not recommended) or make a /var/run/clamd/ 
subdirectory and chown that to clamd.

> +++ Started at Wed Nov 30 16:45:53 2005
> clamd daemon 0.87.1 (OS: linux-gnu, ARCH: i386, CPU: i686)
> Log file size limited to 1048576 bytes.
> Running as user clamav (UID 505, GID 506)
> Reading databases from /var/lib/clamav
> Protecting against 41292 viruses.
> ERROR: Socket file /tmp/clamd is in use by another process.

That's not a good thing.

> SelfCheck: Database status OK.
> 
> the freshclamd.conf minus blanklines and comments looks like this
> 
> DatabaseDirectory /var/lib/clamav
> 
> UpdateLogFile /var/log/freshclam.log
> 
> LogVerbose
> 
> LogSyslog
> 
> PidFile /var/run/freshclam.pid
> 
> DatabaseMirror database.clamav.net

Kill all your freshclam and clamd processes.  Put your .pid and socket files in 
a place that clamd can write.  clamd starts as root, but if it needs to SIGHUP, 
it needs to recreate the .pid files and reinitialize the socket as clamd.

-- 
Matthew.van.Eerde (at) hbinc.com               805.964.4554 x902
Hispanic Business Inc./HireDiversity.com       Software Engineer
_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to