CLAMAV upgrade in Qmail

upgraded the CLAMAV on Qmail server from version 0.87-1 to 0.95.3-1.

Previously there are following two packages were installed.

clamav-0.87-1.i386.rpm
clamav-devel-0.87-1.i386.rpm

Before upgrade the permission of the related files.
[root@webmail bin]# ll /var/lib/clamav
-rw-r--r-- 1 clamav clamav 4105118 Jan 25 07:42 daily.cvd
-rw-r--r-- 1 qscand qscand 21253696 May 15 2009 main.cvd
[root@webmail bin]# ls -ld /var/lib/clamav
drwxrwxr-x 2 qscand clamav 4096 Jan 25 07:42 /var/lib/clamav
-rw-r--r-- 1 root qscand 8156 Nov 6 2008 /etc/clamd.conf
[root@webmail bin]# ll /var/run/clamav
-rw-rw-r-- 1 clamav clamav 5 Jan 25 08:58 clamd.pid
srwxrwxrwx 1 clamav clamav 0 Jan 25 08:58 clamd.sock

[root@webmail bin]# ls -ld /var/run/clamav
drwxr-xr-x 2 clamav clamav 4096 Jan 25 08:58 /var/run/clamav

But in the upgraded one we installed the following four packages.

clamav-0.95.3-1.el4.rf
clamd-0.95.3-1.el4.rf
clamav-db-0.95.3-1.el4.rf
clamav-devel-0.95.3-1.el4.rf

Step 1
Download the packages from the following link.
ftp://194.199.20.114/linux/dag/redhat/e ... f.i386.rpm
ftp://194.199.20.114/linux/dag/redhat/e ... f.i386.rpm
ftp://194.199.20.114/linux/dag/redhat/e ... f.i386.rpm
ftp://194.199.20.114/linux/dag/redhat/e ... f.i386.rpm

STEP 2

Upgrade with the following command

rpm -Uvh clamav-0.95.3-1.el4.rf.i386.rpm clamav-db-0.95.3-1.el4.rf.i386.rpm clamav-devel-0.95.3-1.el4.rf.i386.rpm clamd-0.95.3-1.el4.rf.i386.rpm

STEP 3

Change the permission for the following

[root@webmail ~]# usermod -G qscand clamav
[root@webmail bin]# chown clamav:qscand -R /var/run/clamav

STEP 4
Restart the clamav as /etc/init.d/clamav and qmailctl.

Verify the mail transaction from the web portal.


After the upgrade of the clamav was getting the following errors in /var/log/messages.

lstat() failed on: /var/spool/qmailscan/tmp/webmail.coregreen.in126567279777512992
lstat() failed on: /var/spool/qmailscan/tmp/webmail.coregreen.in126568219577515339
lstat() failed on: /var/spool/qmailscan/tmp/webmail.coregreen.in126568768577516733
lstat() failed on: /var/spool/qmailscan/tmp/webmail.coregreen.in126568773977516783
lstat() failed on: /var/spool/qmailscan/tmp/webmail.coregreen.in126568773977516785

Status of the required files and directory before making the changes.

[root@webmail ~]# ls -ld /var/spool/qmailscan/tmp/
drwxrwxrwx 32 qscand qscand 4096 Feb 10 03:27 /var/spool/qmailscan/tmp/

[root@webmail ~]# ps -ef | grep clam
clamav 3388 1 0 Feb02 ? 00:00:48 clamd
root 4655 4589 0 04:33 pts/0 00:00:00 grep clam

[root@webmail ~]# ll /var/log/clamav/
total 364
-rw-r--r-- 1 clamav clamav 50687 Feb 10 04:35 clamd.log
-rw-r--r-- 1 clamav clamav 129715 Feb 7 04:02 clamd.log.1
-rw-r----- 1 clamav clamav 118954 Jan 31 04:02 clamd.log.2
-rw-r----- 1 clamav clamav 0 Jan 17 04:02 clamd.log.3
-rw-r----- 1 clamav clamav 0 Jan 10 04:02 clamd.log.4
-rw-r----- 1 clamav clamav 0 Jul 5 2009 clamd.log.old
-rw-r----- 1 qscand qscand 837 Nov 6 2008 clam-update.log
-rw-r--r-- 1 clamav clamav 3316 Feb 10 04:02 freshclam.log
-rw-r--r-- 1 clamav clamav 14176 Feb 7 04:02 freshclam.log.1
-rw-r----- 1 clamav clamav 12129 Jan 31 04:02 freshclam.log.2
-rw-r----- 1 clamav clamav 7555 Jan 24 01:27 freshclam.log.3
-rw-r----- 1 clamav clamav 6493 Jan 17 01:26 freshclam.log.4

[root@webmail ~]# ls -ld /var/log/clamav/
drwxr-xr-x 2 clamav clamav 4096 Feb 7 04:02 /var/log/clamav/

[root@webmail clamav]# ls -ld /var/run/clamav/
drwxr-xr-x 2 clamav qscand 4096 Feb 10 04:35 /var/run/clamav/

Following is the changes need to made to resolve the above error:-

[root@webmail ~]# chown qscand:qscand /var/log/clamav/

[root@webmail clamav]# chmod 775 /var/run/clamav/

Now you are rocking...........


Comments

Popular posts from this blog

configure Netbackup email notification on Unix