LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-31-2010, 04:33 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 50
ERROR: /var/log/clamav/freshclam.log is locked by another process


hi

I've clamav daemon installed on debian lenny:
Code:
# dpkg -l | grep clamav
ii  clamav                               0.95.3+dfsg-1~volatile1                         anti-virus utility for Unix - command-line interface
ii  clamav-base                          0.95.3+dfsg-1~volatile1                         anti-virus utility for Unix - base package
ii  clamav-daemon                        0.95.3+dfsg-1~volatile1                         anti-virus utility for Unix - scanner daemon
ii  clamav-freshclam                     0.95.3+dfsg-1~volatile1                         anti-virus utility for Unix - virus database update utility
rc  libclamav2                           0.91.2-1~volatile1                              virus scanner library
rc  libclamav3                           0.92.1~dfsg-1volatile2                          virus scanner library
ii  libclamav5                           0.94.dfsg.2-1lenny2                             anti-virus utility for Unix - library
ii  libclamav6                           0.95.3+dfsg-1~volatile1                         anti-virus utility for Unix - library
Using freshclam I'm getting the following error:
Code:
# freshclam
ERROR: /var/log/clamav/freshclam.log is locked by another process
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
my /etc/clamav/freshclam.conf
Code:
DatabaseOwner clamav
UpdateLogFile /var/log/clamav/freshclam.log
LogVerbose false
LogSyslog false
LogFacility LOG_LOCAL6
LogFileMaxSize 0
LogTime no
Foreground false
Debug false
MaxAttempts 5
DatabaseDirectory /var/lib/clamav/
DNSDatabaseInfo current.cvd.clamav.net
AllowSupplementaryGroups false
PidFile /var/run/clamav/freshclam.pid
ConnectTimeout 30
ReceiveTimeout 30
ScriptedUpdates yes
CompressLocalDatabase no
# Check for new database 24 times a day
Checks 24
DatabaseMirror db.local.clamav.net
DatabaseMirror database.clamav.net
DatabaseMirror clamav.gencore.org
DatabaseMirror clamav.datev.de
DatabaseMirror clamav.ftp.genotec.ch
DatabaseMirror switch.clamav.net
DatabaseMirror db.ch.clamav.net
and in /var/log/clamav/ I have the following permissions:
Code:
# ls -l /var/log/clamav/
total 100
-rw-r----- 1 clamav adm    0 2010-01-31 11:00 clamav.log
-rw-r----- 1 clamav adm 1555 2010-01-31 11:00 clamav.log.1
-rw-r----- 1 clamav adm  124 2010-01-31 02:00 clamav.log.10.gz
-rw-r----- 1 clamav adm  117 2010-01-31 00:00 clamav.log.11.gz
-rw-r----- 1 clamav adm   20 2010-01-30 23:00 clamav.log.12.gz
-rw-r----- 1 clamav adm  124 2010-01-31 10:00 clamav.log.2.gz
-rw-r----- 1 clamav adm  120 2010-01-31 08:00 clamav.log.3.gz
-rw-r----- 1 clamav adm  117 2010-01-31 07:00 clamav.log.4.gz
-rw-r----- 1 clamav adm   20 2010-01-31 06:00 clamav.log.5.gz
-rw-r----- 1 clamav adm  123 2010-01-31 06:00 clamav.log.6.gz
-rw-r----- 1 clamav adm  121 2010-01-31 05:00 clamav.log.7.gz
-rw-r----- 1 clamav adm  198 2010-01-31 03:00 clamav.log.8.gz
-rw-r----- 1 clamav adm   20 2010-01-31 02:00 clamav.log.9.gz
-rw-r----- 1 clamav adm  261 2010-01-31 11:00 freshclam.log
-rw-r----- 1 clamav adm  661 2010-01-31 11:00 freshclam.log.1
-rw-r----- 1 clamav adm   20 2010-01-31 01:00 freshclam.log.10.gz
-rw-r----- 1 clamav adm   20 2010-01-31 00:00 freshclam.log.11.gz
-rw-r----- 1 clamav adm   20 2010-01-30 23:00 freshclam.log.12.gz
-rw-r----- 1 clamav adm   20 2010-01-31 09:00 freshclam.log.2.gz
-rw-r----- 1 clamav adm   20 2010-01-31 08:00 freshclam.log.3.gz
-rw-r----- 1 clamav adm   20 2010-01-31 07:00 freshclam.log.4.gz
-rw-r----- 1 clamav adm   20 2010-01-31 06:00 freshclam.log.5.gz
-rw-r----- 1 clamav adm   20 2010-01-31 05:00 freshclam.log.6.gz
-rw-r----- 1 clamav adm   20 2010-01-31 04:00 freshclam.log.7.gz
-rw-r----- 1 clamav adm   20 2010-01-31 03:00 freshclam.log.8.gz
-rw-r----- 1 clamav adm  276 2010-01-31 02:03 freshclam.log.9.gz
Howto solve this problem?
 
Old 01-31-2010, 05:05 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Seems to me there is a daemon running
Code:
/etc/init.d/clamav-freshclam
Code:
cannabis:/home/repo# ps ax | grep freshclam
 2827 ?        Ss     0:00 /usr/bin/freshclam -d --quiet
 2848 pts/0    S+     0:00 grep freshclam
cannabis:/home/repo#
Stop the daemon and run freshclam in a terminal or let the daemon do his thing
 
Old 01-31-2010, 06:00 AM   #3
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Hi,

check which process is holding a pointer to the file using
Code:
lsof $FILENAME
, this provides information on which process is locking the file.
 
Old 09-23-2014, 02:38 AM   #4
xapxap
LQ Newbie
 
Registered: Sep 2014
Posts: 1

Rep: Reputation: Disabled
Script to kill hanging freshclam

#!/bin/bash
stuckclam=`lsof -t /var/log/clamav/freshclam.log`
#echo $stuckclam
if [[ $stuckclam ]]
then
kill -9 $stuckclam
logger freshclam killed
fi
exit

I run this from cron 1 hour before the freshclam runs
42 5 * * * /usr/local/bin/checkClamLock.sh
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel log format in /var/log/kern.log sinu_nayak2001 Linux - Newbie 2 10-07-2009 08:34 AM
Can't open /var/log/clamav/freshclam.log in append mode i_nomad Linux - Software 2 07-14-2009 05:06 AM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
ClamAV (Freshclam) config problem - cannot append to log file tp11235 Linux - Security 6 09-29-2006 03:54 PM
Error log in /var/log/messages raymond117 Linux - Security 9 01-26-2005 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration