URL: https://www.overclockers.at/linux/freshclam-problem-with-internal-logger_238658/page_2 - zur Vollversion wechseln!
Code:[root@localhost ~]# su clamav -s /bin/sh -c 'freshclam -v' Current working dir is /var/lib/clamav Max retries == 3 ERROR: Can't create temporary directory /var/lib/clamav/clamav-51f723db34244446741fc7b08437657a.tmp Hint: The database directory must be writable for UID 490 or GID 484
ZitatHint: The database directory must be writable for UID 490 or GID 484
Code:getent passwd 490
Code:ls -ld /var/lib/clamav
Code:ps axl | grep clamd
Die rechte scheinen zu paasen, ich werde mal clamav neu installieren.Code:[root@localhost ~]# getent passwd 490 clamav:x:490:484:Clam Anti Virus Checker:/var/clamav:/sbin/nologin [root@localhost ~]# ls -ld /var/log/clamav drwxr-xr-x. 2 clamav clamav 4096 Apr 20 03:53 /var/log/clamav [root@localhost ~]# ps axl | grep clamd 0 0 25186 24625 20 0 103252 808 pipe_w S+ pts/1 0:00 grep clamd [root@localhost ~]# service clamd start Starting Clam AntiVirus Daemon: ERROR: Can't open /var/log/clamav/clamd.log in append mode (check permissions!). ERROR: Can't initialize the internal logger [FAILED]
Könnte auch an SELinux liegen:
Code:grep clam /etc/selinux/targeted/contexts/files/file_contexts
selinux hab ich gerade deaktiviert
hat aber nichts geändert.Code:[root@localhost var]# echo 0 >/selinux/enforce
Code:[root@localhost var]# grep clam /etc/selinux/targeted/contexts/files/file_contexts /var/clamav(/.*)? system_u:object_r:antivirus_db_t:s0 /var/lib/clamd.* system_u:object_r:antivirus_db_t:s0 /var/log/clamd.* system_u:object_r:antivirus_log_t:s0 /var/run/clamd.* system_u:object_r:antivirus_var_run_t:s0 /var/log/clamav.* system_u:object_r:antivirus_log_t:s0 /var/run/clamav.* system_u:object_r:antivirus_var_run_t:s0 /var/lib/clamav(/.*)? system_u:object_r:antivirus_db_t:s0 /var/run/amavis(d)?/clamd\.pid -- system_u:object_r:antivirus_var_run_t:s0 /var/log/freshclam.* -- system_u:object_r:antivirus_log_t:s0 /etc/rc\.d/init\.d/clamd.* -- system_u:object_r:antivirus_initrc_exec_t:s0 /var/log/clamav/freshclam.* -- system_u:object_r:antivirus_log_t:s0 /usr/sbin/clamd -- system_u:object_r:antivirus_exec_t:s0 /usr/bin/clamscan -- system_u:object_r:antivirus_exec_t:s0 /usr/bin/clamdscan -- system_u:object_r:antivirus_exec_t:s0 /usr/bin/freshclam -- system_u:object_r:antivirus_exec_t:s0 /usr/sbin/clamav-milter -- system_u:object_r:antivirus_exec_t:s0 /usr/share/clamav/clamd-gen -- system_u:object_r:bin_t:s0 /usr/share/clamav/freshclam-sleep -- system_u:object_r:bin_t:s0
UID 500 und GID 500 = user und group des standard-usersCode:[server@localhost ~]$ freshclam ERROR: Can't create temporary directory /var/clamav/clamav-16cc5280db852264106e90ca90749dcc.tmp Hint: The database directory must be writable for UID 500 or GID 500
Code:[root@localhost var]# ls -ld /var/log/clamav/ drwxrwxrwx. 2 clamav clamav 4096 Apr 21 17:01 /var/log/clamav/ [root@localhost var]# ls -l /var/log/clamav/* -rw-rw-rw-. 1 clamav clamav 557 Apr 21 16:56 /var/log/clamav/clamd.log -rw-rw-rw-. 1 clamav clamav 60445 Mar 16 04:04 /var/log/clamav/clamd.log-20140316 -rw-rw-rw-. 1 clamav clamav 60858 Mar 23 04:35 /var/log/clamav/clamd.log-20140323 -rw-rw-rw-. 1 clamav clamav 59914 Mar 30 03:23 /var/log/clamav/clamd.log-20140330 -rw-rw-rw-. 1 clamav clamav 59144 Apr 5 19:44 /var/log/clamav/clamd.log-20140406 -rw-rw-rw-. 1 clamav clamav 8367 Apr 21 17:19 /var/log/clamav/freshclam.log -rw-rw-rw-. 1 clamav clamav 4685 Mar 30 03:23 /var/log/clamav/freshclam.log-20140330 -rw-rw-rw-. 1 clamav clamav 4152 Apr 6 03:55 /var/log/clamav/freshclam.log-20140406 -rw-rw-rw-. 1 clamav clamav 2672 Apr 16 12:10 /var/log/clamav/freshclam.log-20140417 -rw-rw-rw-. 1 clamav clamav 1238 Apr 18 18:59 /var/log/clamav/freshclam.log-20140420 -rw-rw-rw-. 1 clamav clamav 8 Apr 21 14:49 /var/log/clamav/freshclamtest -rw-rw-rw-. 1 clamav clamav 336 Apr 21 17:01 /var/log/clamav/scan.log -rw-rw-rw-. 1 clamav clamav 312143704 Apr 21 16:01 /var/log/clamav/scan.log.old [root@localhost var]# freshclam ClamAV update process started at Mon Apr 21 17:19:27 2014
ZitatERROR: Can't create temporary directory /var/clamav/clamav-16cc5280db852264106e90ca90749dcc.tmp
aah ich hab immer log gelesen statt libZitat von lukaDeine freshclam.conf und clamd.conf passen nicht zusammen. Freshclam sucht im Verzeichnis /var/clamav, vorher war es noch /var/lib/clamav.
Da wurden ziemlich sicher zwei inkompatible Pakete aus verschiedene Quellen vermischt.
Finde heraus welche Pfade dein installiertes Paket verwendet (/var/clamav oder /var/{lib,run,log}/clamav). Passe die Konfigurationsdateien (DatabaseDirectory usw.) und die Dateirechte entsprechend an.
database directory ist jetzt für clamd und freshclam auf /var/clamav gesetzt, permissions auf 755 und owner clamav. (/var/lib/clamav existiert, ist aber leer)Code:[root@localhost log]# ls /var/clamav bytecode.cvd daily.cvd main.cvd mirrors.dat [root@localhost var]# ls -ld /var/clamav drwxr-xr-x. 2 clamav clamav 4096 Apr 21 18:33 /var/clamav
Zitat von wergorwenn ich die permission für /var/clamav auf 777 setze, kann ich auch mit dem standarduser freshclam ausführen. da passt ja irgendwas nicht, wieso braucht der ausführende user (schreib)zugriff wenn freshclam ja sowieso die rechte dropped und zum user clamav wechselt
Zitat/var/log/clamav braucht nach wie vor permission 666, wenn ich freshclam als standarduser aufrufen will, als root gehts auch mit 644 etc![]()
Code:DatabaseOwner STRING When started by root, drop privileges to a specified user.
ahja, lesen sollte man halt könnenZitat von lukaEin Programm darf nur die UID ändern, wenn es von root ausgeführt wurde (oder wenn die Datei das setuid bit gesetzt hat) - vereinfacht gesagt.Code:DatabaseOwner STRING When started by root, drop privileges to a specified user.
Wenn du freshclam als root ausführst, wird zu dem Benutzer gewechselt, der als DatabaseOwner in der freshclam.conf gesetzt wurde.
overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2025