Re: [Clamav-users] freshclam - ERROR: Can't lock database directory:-stale .dbLock file
On Mon, 26 Feb 2007 23:41:39 -0800 Dennis Peterson [EMAIL PROTECTED] wrote: Wolf, Brian wrote: Brian wrote: both freshclam and clamd 0.90 have been dying with Can't lock database directory every time a new version of signatures comes out. It looks like my problem was caused by having freshclam run a script after an update using the OnUpdateExecute line in freshclam.conf. The script created a file containing the EICAR pattern and then scanned it with cat /tmp/eicar.com | /usr/local/bin/clamscan --quiet - Once I removed the clamscan command, the error went away. This command worked okay in previous versions. I get that same error and I don't run a script. Still haven't figured it out. Does it occur with each run of freshclam? -- oo. Tomasz Kojm [EMAIL PROTECTED] (\/)\. http://www.ClamAV.net/gpg/tkojm.gpg \..._ 0DCA5A08407D5288279DB43454822DC8985A444B //\ /\ Tue Feb 27 10:09:52 CET 2007 ___ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html
Re: [Clamav-users] freshclam - ERROR: Can't lock database directory:-stale .dbLock file
Tomasz Kojm wrote: On Mon, 26 Feb 2007 23:41:39 -0800 Dennis Peterson [EMAIL PROTECTED] wrote: Wolf, Brian wrote: Brian wrote: both freshclam and clamd 0.90 have been dying with Can't lock database directory every time a new version of signatures comes out. It looks like my problem was caused by having freshclam run a script after an update using the OnUpdateExecute line in freshclam.conf. The script created a file containing the EICAR pattern and then scanned it with cat /tmp/eicar.com | /usr/local/bin/clamscan --quiet - Once I removed the clamscan command, the error went away. This command worked okay in previous versions. I get that same error and I don't run a script. Still haven't figured it out. Does it occur with each run of freshclam? Yes. dp ___ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html
Re: [Clamav-users] freshclam - ERROR: Can't lock database directory:-stale .dbLock file
Dennis Peterson wrote: Tomasz Kojm wrote: On Mon, 26 Feb 2007 23:41:39 -0800 Dennis Peterson [EMAIL PROTECTED] wrote: Wolf, Brian wrote: Brian wrote: both freshclam and clamd 0.90 have been dying with Can't lock database directory every time a new version of signatures comes out. It looks like my problem was caused by having freshclam run a script after an update using the OnUpdateExecute line in freshclam.conf. The script created a file containing the EICAR pattern and then scanned it with cat /tmp/eicar.com | /usr/local/bin/clamscan --quiet - Once I removed the clamscan command, the error went away. This command worked okay in previous versions. I get that same error and I don't run a script. Still haven't figured it out. Does it occur with each run of freshclam? Yes. Let me expand some, because something's changed. Some days ago I redirected stdout and error out to dev/null because of the cron mail that was being send when running freshclam. I just ran it from the command line and it worked fine - no error. Nothing changed (something I'm sure of is wrong :) ) but now the error is gone. I've removed the error redirection from the cron process and will monitor again. dp ___ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html
RE: [Clamav-users] freshclam - ERROR: Can't lock database directory:-stale .dbLock file
Brian wrote: both freshclam and clamd 0.90 have been dying with Can't lock database directory every time a new version of signatures comes out. It looks like my problem was caused by having freshclam run a script after an update using the OnUpdateExecute line in freshclam.conf. The script created a file containing the EICAR pattern and then scanned it with cat /tmp/eicar.com | /usr/local/bin/clamscan --quiet - Once I removed the clamscan command, the error went away. This command worked okay in previous versions. ___ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html
Re: [Clamav-users] freshclam - ERROR: Can't lock database directory:-stale .dbLock file
Wolf, Brian wrote: Brian wrote: both freshclam and clamd 0.90 have been dying with Can't lock database directory every time a new version of signatures comes out. It looks like my problem was caused by having freshclam run a script after an update using the OnUpdateExecute line in freshclam.conf. The script created a file containing the EICAR pattern and then scanned it with cat /tmp/eicar.com | /usr/local/bin/clamscan --quiet - Once I removed the clamscan command, the error went away. This command worked okay in previous versions. I get that same error and I don't run a script. Still haven't figured it out. dp ___ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html
Re: [Clamav-users] freshclam - ERROR: Can't lock database directory: - stale .dbLock file
Paul Griffith wrote: Greetings, 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. Hi Paul, This happened to me a couple of times when I killed (TERM) freshclam while a download was in progress... Unfortunately I'm unable to reproduce the problem. Could you please provide some hints? -aCaB ___ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html
RE: [Clamav-users] freshclam - ERROR: Can't lock database directory: -stale .dbLock file
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
Re: [Clamav-users] freshclam - ERROR: Can't lock database directory: - stale .dbLock file
On Thu, 22 Feb 2007 11:52:08 -0500, aCaB [EMAIL PROTECTED] wrote: Paul Griffith wrote: Greetings, 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. Hi Paul, This happened to me a couple of times when I killed (TERM) freshclam while a download was in progress... Unfortunately I'm unable to reproduce the problem. Could you please provide some hints? -aCaB I will see what happens today, I didn't do anything special in my setup. The only unique thing in my setup is that my database sits on a NFS share. Here is what the stale .dbLock file looks like: #ls -lait total 8962 545006030 -rwxrwxr-- 1 clamav clamav 0 Feb 22 02:28 .dbLock* The million dollar question is what happened between Feb 21 17:28 and Feb 22 02:28. Here are some log snippets... --from /var/log/freshclam.0 ClamAV update process started at Wed Feb 21 15:28:06 2007 main.cvd is up to date (version: 42, sigs: 83951, f-level: 10, builder: tkojm) daily.inc is up to date (version: 2622, sigs: 9581, f-level: 13, builder: ccordes) -- ClamAV update process started at Wed Feb 21 16:28:02 2007 main.cvd is up to date (version: 42, sigs: 83951, f-level: 10, builder: tkojm) daily.inc is up to date (version: 2622, sigs: 9581, f-level: 13, builder: ccordes) -- ClamAV update process started at Wed Feb 21 17:28:01 2007 main.cvd is up to date (version: 42, sigs: 83951, f-level: 10, builder: tkojm) Downloading daily-2623.cdiff [0%] daily.inc updated (version: 2623, sigs: 9598, f-level: 13, builder: ccordes) Database updated (93549 signatures) from db.ca.clamav.net (IP: 24.215.0.24) -- ERROR: Can't lock database directory: /cs/local/share/clamav -- ERROR: Can't lock database directory: /cs/local/share/clamav -- Thanks Paul ___ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html
RE: [Clamav-users] freshclam - ERROR: Can't lock database directory:-stale .dbLock file
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. BTW, here are the permissions on the database directory and files: $ ls -lad /usr/local/share/clamav drwxrwxr-x 3 clamav clamav 4096 Feb 22 12:22 /usr/local/share/clamav $ ls -la /usr/local/share/clamav total 8048 drwxrwxr-x 3 clamav clamav4096 Feb 22 12:22 . drwxr-xr-x 5 root root 4096 Feb 21 14:36 .. drwxr-xr-x 2 clamav clamav4096 Feb 22 11:22 daily.inc -rw-rw-r-- 1 clamav clamav 8189490 Feb 21 14:36 main.cvd -rw--- 1 clamav clamav 260 Feb 22 12:22 mirrors.dat $ ls -la /usr/local/share/clamav/daily.inc total 1780 drwxr-xr-x 2 clamav clamav4096 Feb 22 11:22 . drwxrwxr-x 3 clamav clamav4096 Feb 22 12:22 .. -rw-r--r-- 1 clamav clamav 17992 Feb 21 14:37 COPYING -rw-r--r-- 1 clamav clamav 19 Feb 21 14:37 daily.cfg -rw-r--r-- 1 clamav clamav 23073 Feb 22 04:22 daily.db -rw-r--r-- 1 clamav clamav2109 Feb 21 18:22 daily.fp -rw-r--r-- 1 clamav clamav 10097 Feb 22 11:22 daily.hdb -rw-r--r-- 1 clamav clamav 410 Feb 22 11:22 daily.info -rw-r--r-- 1 clamav clamav 191419 Feb 22 06:22 daily.mdb -rw-r--r-- 1 clamav clamav 1478099 Feb 22 11:22 daily.ndb -rw-r--r-- 1 clamav clamav1694 Feb 21 18:22 daily.pdb -rw-r--r-- 1 clamav clamav 205 Feb 21 14:37 daily.wdb -rw-r--r-- 1 clamav clamav1848 Feb 21 14:37 daily.zmd $ egrep clamav /etc/passwd clamav:x:502:502:Clam Antivirus:/home/clamav:/bin/false $ egrep clamav /etc/group clamav:x:502:bwolf - Brian ___ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html