ClamAV Upgrade Ritual

|

Following the usual 'make uninstall' prior to upgrading my clamav doesn't always ensure I will have no further problems. Generally the next step after you 'make install' your new clamav. Then you want to run a 'freshclam'. But here is where I constantly forget and am now documenting how I fix this LibClamAV Error:

[root@soyo clamav]# freshclam
ClamAV update process started at Wed Nov 14 09:14:50 2007
main.inc is up to date (version: 44, sigs: 133163, f-level: 20, builder: sven)
daily.inc is up to date (version: 4783, sigs: 35144, f-level: 21, builder: ccordes)
LibClamAV Error: Database Directory: /usr/local/share/clamav not locked

Not a lot of info on what exactly the not locked means, but if you suspect permissions you are probably right. Lets see:

[root@soyo clamav]# ls -lha
total 24K
drwxrwxr-x 4 clamav clamav 4.0K Nov 14 08:48 .
drwxr-xr-x 7 root root 4.0K Jul 2 10:31 ..
drwxr-xr-x 2 clamav clamav 4.0K Nov 14 08:48 daily.inc
-rwxrwxr-- 1 root root 0 Nov 14 09:22 .dbLock
drwxr-xr-x 2 clamav clamav 4.0K Nov 14 08:23 main.inc
-rw------- 1 clamav clamav 1.4K Nov 14 09:14 mirrors.dat

Okay so .dblock is the culprit.

[root@soyo clamav]# cd ..
[root@soyo share]# chown -R clamav.clamav clamav/
[root@soyo share]# freshclam
ClamAV update process started at Wed Nov 14 09:23:19 2007
main.inc is up to date (version: 44, sigs: 133163, f-level: 20, builder: sven)
daily.inc is up to date (version: 4783, sigs: 35144, f-level: 21, builder: ccordes)

Voilà!