Paul Griffith wrote:

> Has anyone encountered the following problem:
>
> Somehow there was a stale .dbLock file in the database directory, and
the  
> log file was full of
> 'ERROR: Can't lock database directory: /cs/local/share/clamav' I did a
strace and saw the freashclam was trying to create a new .dbLock  
> file, but it kept failing due to the existing .dbLock file. I am going
to  
> assume that a previous freshclam didn't exit cleanly and left a
.dbLock  
> around, is there a FixStaleDBLock file option similar to the  
> FixStaleSocket option?
>
> We normally run freshclam out of cron, ClamAv version 0.90 and we are

> using ScriptedUpdates.



I haven't seen a stale .dbLock file, but both freshclam and clamd 0.90
have been dying with "Can't lock database directory" every time a new
version of signatures comes out.  This is on a RedHat Advanced Server 4
system.  I have pasted portions of the logs below.  Freshclam runs as a
cron job under root.  Freshclam.conf sets "DatabaseOwner clamav", and
clamd.conf set "User clamav".  I have tried using the default database
directory of /usr/local/share/clamav, which is what the logs below show.
I also tried building using --with-dbdir=<a different directory> and
setting DatabaseDirectory accordingly in both .conf files, and got the
same result.  

This morning's run was after doing a "make uninstall", "make clean",
deleting the /usr/local/share/clamav directory tree, and rebuilding with
the defaults.  The results are the same- every time freshclam pulls down
a new version, it notifies clamd, then gets the directory-locked error.
Then clamd dies with the same error.

- Brian


Output of freshclam cron job:

ClamAV update process started at Thu Feb 22 11:22:01 2007
main.cvd is up to date (version: 42, sigs: 83951, f-level: 10, builder:
tkojm)
Downloading daily-2629.cdiff [100%]
Downloading daily-2629.cdiff [100%]
daily.inc updated (version: 2629, sigs: 9682, f-level: 13, builder:
trog)
Database updated (93633 signatures) from database.clamav.net (IP:
194.47.250.218)
Clamd successfully notified about the update.
LibClamAV Error: cl_load(): Unable to lock database directory:
/usr/local/share/clamav
ERROR: Unable to lock database directory


Freshclam.log

Current working dir is /usr/local/share/clamav
Max retries == 3
ClamAV update process started at Thu Feb 22 11:22:01 2007
Querying current.cvd.clamav.net
TTL: 900
Software version from DNS: 0.90
main.cvd version from DNS: 42
main.cvd is up to date (version: 42, sigs: 83951, f-level: 10, builder:
tkojm)
daily.cvd version from DNS: 2629
Retrieving http://database.clamav.net/daily-2629.cdiff
Trying to download http://database.clamav.net/daily-2629.cdiff (IP:
194.47.250.218)
Downloading daily-2629.cdiff [100%]
cdiff_apply: Parsed 21 lines and executed 21 commands
Removing backup directory ./clamav-2a20716f43129d951049dd17771ad60e
daily.inc updated (version: 2629, sigs: 9682, f-level: 13, builder:
trog)
Database updated (93633 signatures) from database.clamav.net (IP:
194.47.250.218)
Clamd successfully notified about the update.





clamd.log:

Thu Feb 22 08:42:47 2007 -> +++ Started at Thu Feb 22 08:42:47 2007
Thu Feb 22 08:42:47 2007 -> clamd daemon 0.90 (OS: linux-gnu, ARCH:
i386, CPU: i686)
Thu Feb 22 08:42:47 2007 -> Log file size limited to 1048576 bytes.
Thu Feb 22 08:42:47 2007 -> Reading databases from
/usr/local/share/clamav
Thu Feb 22 08:42:49 2007 -> Loaded 93621 signatures.
Thu Feb 22 08:42:49 2007 -> Unix socket file /tmp/clamd
Thu Feb 22 08:42:49 2007 -> Setting connection queue length to 15
Thu Feb 22 08:42:49 2007 -> Archive: Archived file size limit set to
10485760 bytes.
Thu Feb 22 08:42:49 2007 -> Archive: Recursion level limit set to 8.
Thu Feb 22 08:42:49 2007 -> Archive: Files limit set to 1000.
Thu Feb 22 08:42:49 2007 -> Archive: Compression ratio limit set to 250.
Thu Feb 22 08:42:49 2007 -> Archive support enabled.
Thu Feb 22 08:42:49 2007 -> Algorithmic detection enabled.
Thu Feb 22 08:42:49 2007 -> Portable Executable support enabled.
Thu Feb 22 08:42:49 2007 -> ELF support enabled.
Thu Feb 22 08:42:49 2007 -> Mail files support enabled.
Thu Feb 22 08:42:49 2007 -> Mail: Recursion level limit set to 64.
Thu Feb 22 08:42:49 2007 -> OLE2 support enabled.
Thu Feb 22 08:42:49 2007 -> HTML support enabled.
Thu Feb 22 08:42:49 2007 -> Self checking every 1800 seconds.
Thu Feb 22 11:22:02 2007 -> No stats for Database check - forcing reload
Thu Feb 22 11:22:02 2007 -> Reading databases from
/usr/local/share/clamav
Thu Feb 22 11:24:12 2007 -> ERROR: reload db failed: Unable to lock
database directory
Thu Feb 22 11:24:12 2007 -> Terminating because of a fatal error.Thu Feb
22 11:24:12 2007 -> Socket file removed.
Thu Feb 22 11:24:12 2007 -> Pid file removed.
Thu Feb 22 11:24:12 2007 -> --- Stopped at Thu Feb 22 11:24:12 2007
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html

Reply via email to