Following a previous thread's suggestion, I've been using freshclam with the 
"--on-update-execute=EXIT_1" argument in a script. However, I've been winding 
up with temp files in the database dir. If I'm reading the code right, because 
it exits in downloadmanager() when "execute(OnUpdateExecute..." is called, it 
never calls cli_rmdirs().  Below is strace output from updates with and without 
the EXIT_1 option. You can see a lot of cleanup being missed when using it. Can 
this be fixed? 


freshclam WITH --on-update-execute=EXIT_1 option

open("bytecode.cld", O_RDONLY)          = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=73728, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40190000
read(3, "ClamAV-VDB:08 Jul 2010 12-46 -04"..., 4096) = 4096
close(3)                                = 0
munmap(0x40190000, 4096)                = 0
write(1, "bytecode.cld is up to date (vers"..., 81) = 81
open("mirrors.dat", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 3
time(NULL)                              = 1279105603
write(3, "\325\245P\237C\232=L\10\0\0\0\0\0\0\0\0n, 15 Feb 2010 "..., 780) = 780
close(3)                                = 0
write(1, "Database updated (807539 signatu"..., 80) = 80
open("/etc/clamd.conf", O_RDONLY)       = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=13647, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40190000
read(3, "##\n## Example config file for th"..., 4096) = 4096
read(3, " possible.\n# WARNING: you should"..., 4096) = 4096
read(3, "loaked URLs, even if URL isn\'t i"..., 4096) = 4096
read(3, "l be scanned). You can have\n# mu"..., 4096) = 1359
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40190000, 4096)                = 0
socket(PF_UNIX, SOCK_STREAM, 0)         = 3
connect(3, {sa_family=AF_UNIX, path="/var/run/clamav/clamd.sock"}, 110) = 0
send(3, "RELOAD", 6, 0)                 = 6
recv(3, "RELOADING\n", 20, 0)           = 10
close(3)                                = 0
write(1, "Clamd successfully notified abou"..., 46) = 46
munmap(0x40027000, 4096)                = 0
exit_group(1)                           = ?

============================================================================
freshclam WITHOUT --on-update-execute=EXIT_1 option

open("/etc/clamd.conf", O_RDONLY)       = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=13647, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40190000
read(3, "##\n## Example config file for th"..., 4096) = 4096
read(3, " possible.\n# WARNING: you should"..., 4096) = 4096
read(3, "loaked URLs, even if URL isn\'t i"..., 4096) = 4096
read(3, "l be scanned). You can have\n# mu"..., 4096) = 1359
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40190000, 4096)                = 0
socket(PF_UNIX, SOCK_STREAM, 0)         = 3
connect(3, {sa_family=AF_UNIX, path="/var/run/clamav/clamd.sock"}, 110) = 0
send(3, "RELOAD", 6, 0)                 = 6
recv(3, "RELOADING\n", 20, 0)           = 10
close(3)                                = 0
write(1, "Clamd successfully notified abou"..., 46) = 46
chmod("/var/lib/clamav/clamav-702c015a7e8bdee49595934f30f98332", 0700) = 0
open("/var/lib/clamav/clamav-702c015a7e8bdee49595934f30f98332", 
O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
stat64("/var/lib/clamav/clamav-702c015a7e8bdee49595934f30f98332", 
{st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
rmdir("/var/lib/clamav/clamav-702c015a7e8bdee49595934f30f98332") = 0
brk(0)                                  = 0x8099000
brk(0)                                  = 0x8099000
brk(0x806c000)                          = 0x806c000
brk(0)                                  = 0x806c000
close(3)                                = 0
alarm(0)                                = 0
munmap(0x40027000, 4096)                = 0
exit_group(0)                           = ?

_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to