Sudo freshclam ошибка

17.04.2020

clamav-logo

Сегодня в статье мы рассмотрим ошибку при попытки обновить антивирус ClamAV в операционной системе Linux.

Если выходит сообщение “ClamAV: Error /var/log/clamav/freshclam.log” при попытки обновления антивируса ClamAV командой:

sudo freshclam

Предупреждение:

ERROR: /var/log/clamav/freshclam.log is locked by another process
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
ERROR: initialize: libfreshclam init failed.
ERROR: Initialization error!

Решение ошибки ClamAV: Error /var/log/clamav/freshclam.log

В сообщении сказано, что /var/log/clamav/freshclam.log блокируется другим процессом. Давайте посмотрим каким:

sudo lsof /var/log/clamav/freshclam.log
COMMAND     PID   USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
freshclam 24489 clamav    3wW  REG   8,17    58462 800961 /var/log/clamav/freshclam.log

Из вывода видем что запустил данный процесс сам же clamav.

Как же все таки исправить данную ошибку? Нет ничего проще. Мы знаем что данный процесс запустил сам антивирусник ClamAV. Давайте же остановим его:

sudo /etc/init.d/clamav-freshclam stop

Далее запускаем обновление:

sudo freshclam

Теперь обновление проходит без ошибок. Ну а далее запускаем freshclam для работы в автоматическом режиме:

sudo /etc/init.d/clamav-freshclam start

Если есть вопросы, то пишем в комментариях.

Также можете вступить в Телеграм канал, ВКонтакте или подписаться на Twitter. Ссылки в шапке страницы.
Заранее всем спасибо!!!

RSS

Добавление RSS-ленты на главную страницу этого сайта не поддерживается, так как это может привести к зацикливанию, замедляющему работу вашего сайта. Попробуйте использовать другой блок, например блок Последние записи, для отображения записей сайта.

Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.

If I comment out the UpdateLogFile line from /etc/clamav/freshclam.conf like so…

\#UpdateLogFile /var/log/clamav/freshclam.log

…then I am able to run sudo freshclam no problem:

/etc/clamav$ sudo freshclam ClamAV update process started at Mon Feb 
6 00:17:07 2017 main.cvd is up to date (version: 57, sigs: 4218790,
f-level: 60, builder: amishhammer) daily.cld is up to date (version:
23009, sigs: 1509149, f-level: 63, builder: neo) bytecode.cld is up to
date (version: 290, sigs: 55, f-level: 63, builder: neo)

However, if I uncomment the UpdateLogFile line in freshclam.conf and run sudo freshclam, I get this:

/etc/clamav$ sudo freshclam 
ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

Here are the permissions on /var/log:

drwxrwxrwx  1 root root     9 Feb  3  2016 log

Here are the permissions on /var/log/clamav:

drwxr-xr-x  2 clamav    clamav    4096 Feb  5 22:18 clamav

And here are the permissions on /var/log/clamav/freshclam.log:

-rw-r-----  1 clamav adm       0 Feb  5 22:18 freshclam.log

I spent all day trying solutions mentioned in various forums with no luck.

Here is the version of Ubuntu server I am running:

Description:    Ubuntu 14.04.5 LTS

And the engine version of clamav:

Engine version: 0.99.2

Could someone help me?

Stopping the clamav-daemon does not help:

/var/log$ sudo /etc/init.d/clamav-daemon stop 

* Stopping ClamAV daemon clamd        
[ OK ]  /var/log$ sudo freshclam
ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check
permissions!). ERROR: Problem with internal logger (UpdateLogFile =
/var/log/clamav/freshclam.log).

The output of sudo lsof | grep clam is nothing:

/var/log$ sudo lsof | grep clam
/var/log$

It appears that nothing has a lock on /var/log/clamav/freshclam.log

Here is the output of sudo service --status-all | grep clamav, not including the lines that had question marks and were unrelated to clamav:

$ sudo service --status-all | grep clamav 
[ - ] clamav-daemon
[ - ] clamav-freshclam
$

Same Can't open /var/log/clamav/freshclam.log in append mode (check permissions!) error when I try to run clamav-daemon:

$ sudo service clamav-daemon start
 * Starting ClamAV daemon clamd
ERROR: Can't open /var/log/clamav/clamav.log in append mode (check permissions!).
ERROR: Can't initialize the internal logger
$

UPDATE: purging and reinstalling clamav, clamav-freshclam and clamav-daemon did not resolve the issue. I still get the same error:

$ sudo freshclam
ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
$

UPDATE 2: I did a sudo reboot, stopped clamav-freshclam, made sure sudo lsof | grep clam returned nothing and that the output of sudo service --status-all | grep clamav still only had minus symbols next to clamav and clamav-daemon. Ran sudo freshclam again, and same error as above (again).

Yodo.im - бот учитель Linux и DevOPS

Загрузка…

Describe the bug

sudo chown dorianrosse:root /var/log/freshclam.log
sudo chmod 751 /var/log/freshclam.log
sudo freshclam
ERROR: Can't open /var/log/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/freshclam.log).
ERROR: initialize: libfreshclam init failed.
ERROR: Initialization error!
freshclam
Sat Mar 19 14:39:42 2022 -> Current working dir is /var/lib/clamav/
Sat Mar 19 14:39:42 2022 -> Loaded freshclam.dat:
Sat Mar 19 14:39:42 2022 ->   version:    1
Sat Mar 19 14:39:42 2022 ->   uuid:       dfb07cc8-31f8-4a74-8e96-a57730ccb88a
Sat Mar 19 14:39:42 2022 -> ClamAV update process started at Sat Mar 19 14:39:42 2022
Sat Mar 19 14:39:42 2022 -> Current working dir is /var/lib/clamav/
Sat Mar 19 14:39:42 2022 -> Querying current.cvd.clamav.net
Sat Mar 19 14:39:42 2022 -> TTL: 220
Sat Mar 19 14:39:42 2022 -> fc_dns_query_update_info: Software version from DNS: 0.103.5
ERROR: Sat Mar 19 14:39:42 2022 -> Can't create temporary directory /var/lib/clamav/tmp.f9148858a6
Sat Mar 19 14:39:42 2022 -> Hint: The database directory must be writable for UID 1000 or GID 1000
ERROR: Sat Mar 19 14:39:42 2022 -> Update failed.
sudo chown clamav:adm /var/lib/clamav
 sudo chown 731 /var/lib/clamav
freshclam
Sun Mar 20 11:17:51 2022 -> Current working dir is /var/lib/clamav/
Sun Mar 20 11:17:51 2022 -> Loaded freshclam.dat:
Sun Mar 20 11:17:51 2022 ->   version:    1
Sun Mar 20 11:17:51 2022 ->   uuid:       dfb07cc8-31f8-4a74-8e96-a57730ccb88a
Sun Mar 20 11:17:51 2022 -> ClamAV update process started at Sun Mar 20 11:17:51 2022
Sun Mar 20 11:17:51 2022 -> Current working dir is /var/lib/clamav/
Sun Mar 20 11:17:51 2022 -> Querying current.cvd.clamav.net
Sun Mar 20 11:17:51 2022 -> TTL: 728
Sun Mar 20 11:17:51 2022 -> fc_dns_query_update_info: Software version from DNS: 0.103.5
ERROR: Sun Mar 20 11:17:51 2022 -> Can't create temporary directory /var/lib/clamav/tmp.f0a837f849
Sun Mar 20 11:17:51 2022 -> Hint: The database directory must be writable for UID 1000 or GID 1000
ERROR: Sun Mar 20 11:17:51 2022 -> Update failed.
sudo freshclam
ERROR: Can't open /var/log/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/freshclam.log).
ERROR: initialize: libfreshclam init failed.
ERROR: Initialization error!
sudo chown 731 /var/log/freshclam.log
sudo chown clamav:adm /var/log/freshclam.log
 sudo freshclam
Sun Mar 20 11:19:17 2022 -> Current working dir is /var/lib/clamav/
Sun Mar 20 11:19:17 2022 -> Loaded freshclam.dat:
Sun Mar 20 11:19:17 2022 ->   version:    1
Sun Mar 20 11:19:17 2022 ->   uuid:       dfb07cc8-31f8-4a74-8e96-a57730ccb88a
Sun Mar 20 11:19:17 2022 -> ClamAV update process started at Sun Mar 20 11:19:17 2022
Sun Mar 20 11:19:17 2022 -> Current working dir is /var/lib/clamav/
Sun Mar 20 11:19:17 2022 -> Querying current.cvd.clamav.net
Sun Mar 20 11:19:17 2022 -> TTL: 643
Sun Mar 20 11:19:17 2022 -> fc_dns_query_update_info: Software version from DNS: 0.103.5
ERROR: Sun Mar 20 11:19:17 2022 -> Can't create temporary directory /var/lib/clamav/tmp.93504dde28
Sun Mar 20 11:19:17 2022 -> Hint: The database directory must be writable for UID 129 or GID 137
ERROR: Sun Mar 20 11:19:17 2022 -> Update failed.
freshclam
ERROR: Can't open /var/log/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/freshclam.log).
ERROR: initialize: libfreshclam init failed.
ERROR: Initialization error!

freshclam is broken but clamscan use the last version :

----------- SCAN SUMMARY -----------
Known viruses: 8608351
Engine version: 0.105.0-rc
Scanned directories: 81064
Scanned files: 578155
Infected files: 63
Total errors: 27817
Not removed: 62
Data scanned: 27184.97 MB
Data read: 31558.27 MB (ratio 0.86:1)
Time: 7671.843 sec (127 m 51 s)
Start Date: 2022:03:19 14:42:44
End Date:   2022:03:19 16:50:36

How to reproduce the problem

sudo freshclam

Replace this text with the output from the ClamAV command:
sudo clamconf -n
Checking configuration files in /usr/local/etc

Config file: clamd.conf

LogFile = «/var/log/clamav.log»
LogTime = «yes»
PidFile = «/var/amavis/clamd.pid»
DatabaseDirectory = «/var/clamav»
LocalSocket = «/var/amavis/clamd»
Foreground = «yes»
*** AllowSupplementaryGroups is DEPRECATED ***

Config file: freshclam.conf

LogTime = «yes»
LogSyslog = «yes»
LogVerbose = «yes»
LogRotate = «yes»
DatabaseDirectory = «/var/lib/clamav»
Debug = «yes»
UpdateLogFile = «/var/log/freshclam.log»
DatabaseMirror = «db.FR.clamav.net», «database.clamav.net»
MaxAttempts = «5»

clamav-milter.conf not found

Software settings

Version: 0.105.0-rc
Optional features supported: MEMPOOL AUTOIT_EA06 BZIP2 LIBXML2 PCRE2 ICONV JSON RAR

Database information

Database directory: /var/lib/clamav
WARNING: freshclam.conf and clamd.conf point to different database directories
main.cvd: version 62, sigs: 6647427, built on Thu Sep 16 14:32:42 2021
daily.cld: version 26486, sigs: 1976332, built on Sat Mar 19 09:21:07 2022
bytecode.cvd: version 333, sigs: 92, built on Mon Mar 8 16:21:51 2021
Total number of signatures: 8623851

Platform information

uname: Linux 5.13.0-35-generic #40~20.04.1-Ubuntu SMP Mon Mar 7 09:18:32 UTC 2022 x86_64
OS: Linux, ARCH: x86_64, CPU: x86_64
Full OS version: Ubuntu 20.04.4 LTS
zlib version: 1.2.11 (1.2.11), compile flags: a9
platform id: 0x0a2196960800000000090400

Build information

GNU C: 9.4.0 (9.4.0)
sizeof(void*) = 8
Engine flevel: 150, dconf: 150

Attachments

If applicable, add screenshots to help explain your problem.

If the issue is reproducible only when scanning a specific file, attach it to the ticket.

If I run sudo freshclam I get this error:

ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

I went to /var/log/clamav to check it’s permissions, but there isn’t a clamav directory there. I tried sudo locate freshclam.log but nothing came back.

I’m running Debian 8 Jessie and ClamAV 0.99.2. I installed ClamAV using sudo apt-get install clamav. Clamscan works fine,

Any ideas?

Peschke's user avatar

Peschke

4,0382 gold badges16 silver badges30 bronze badges

asked Jul 9, 2017 at 11:01

tomh1012's user avatar

Perhaps the same process is already running automatically stop it with the command:

sudo /etc/init.d/clamav-freshclam stop

and try again to manually with the command:

sudo freshclam

answered Aug 9, 2017 at 12:34

mass2's user avatar

mass2mass2

111 bronze badge

1

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

Понравилась статья? Поделить с друзьями:
  • Sudo apt install python3 pip ошибка
  • Storung motorsteuerung ошибка man
  • Sudo apt install openssh server ошибка
  • Sudo apt install gcc ошибка
  • Storsec mbn ошибка