I have installed
clamav and I want to to update the files that it uses to identify viruses:
$ sudo freshclam ERROR: /var/log/clamav/freshclam.log is locked by another process ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
What should I do with this error?
$ sudo lsof /var/log/clamav/freshclam.log COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME freshclam 866 clamav 3wW REG 259,1 100134 10486045 /var/log/clamav/freshclam.log
You don't have to run it manually because it has been run automatically and is running in the background, that's why you receive that message.
If you want to stop the daemon and run it manually:
run it manually:
What is happening and how to handle it?
Every time when you encounter into a similar situations, errors like
file x has been lockedor
Another process is using this file : /path/to/xyou can use the
lsofcommand to find out which process is using that file, in your case if you run:
You should get an output like:
abcis the name of process which is using that file, in your case it's:
freshclamwhich you want to run has been already ran by clamav daemons.
you can use
less /var/log/clamav/freshclam.logor similar commands to see what's going on.
So you don't have to run it manually anymore, it's a process to avoid any conflict and having multiple instance of a same process doing same thing at the same time.
If you want to make it stop and run it manually, then send a
SIGTERMto its process, that gives the process a chance to finish its job and close itself cleanly, something like:
sudomay be necessary.
Then run it manually:
However in this case you can use:
to stop the daemon.