Avast Antivirus

# Avast Troubleshooting

## Install Troubleshooting

### Execution Error: bad ELF interpreter (linux)

If upon running "av_avast" you receive the error:

    bad ELF interpreter: No such file or directory

This should get resolved by installing the "glibc.i686" package.

### Execution Error: avworkInitialize returned 42000 (linux)

Changing shared memory requirements mean that in some cases avast will segfault on startup and in other cases will return the error "avworkInitialize returned 22". This is due to the kernel.shmmax kernel variable being too small. You can check the value using

    sysctl kernel.shmmax

If too small this can be increased using the following command or equivalent. This can be added to surgemail_start.sh as part of its ulimit lines:

    sysctl -w kernel.shmmax=256000000

note: 128000000 used to be enough but as of March 2014 this needs to be higher.

### 64 bit version on linux

Note: This does not apply to most modern default 64 bit linux installs

Avast for linux requires the 32 bit compatibility libraries to be installed in order to be able to run on 64 bit servers. Also on some servers the default distribution will segfault as soon as any av_avast command is run. This is due to faults in the linux distributions that do not call the dynamic library initialisation functions correctly. To fix this, install this patch by following these instructions. You need to upgrade the avast binaries and make sure you have av_avast 1.4 and add the "64BITFIX_INIT true" av_avast.ini setting.

### Uninstall

Under Windows press the uninstall button from the antivirus page of the surgemail web admin interface

For linux just remove the relevant files (antivirus engine, and virus signature database):

    [/usr/lib]# ls -l | grep avast
    lrwxrwxrwx   1 root   root          25 Mar  6  2013 libavastengine-4.so.7 -> libavastengine-4.so.7.0.5*
    -rwxr-xr-x   2 root   root     1889832 Nov  9  2011 libavastengine-4.so.7.0.5*
    lrwxrwxrwx   1 root   root          25 Mar  6  2013 libavastengine.so -> libavastengine-4.so.7.0.5*

    [/var/lib/avast4]# ls -l
    -rw-r--r--  1 mail mail 103866410 Oct 31 12:00 400.vps

## Runtime Troubleshooting

### Automatic Updates fail (linux)

The virus database on linux can be updated by running:

1. "./av_avast -update", this will get automatically run by surgemail
2. "avastvpsupdate.pl", which is running Alwil Software's update script which is likely to have been added as a cron job by the installer.

If you are having trouble with updates on linux try the following steps to resolve:

1. Make sure your surgemail upgrades license is uptodate
2. Try running "./av_avast -update" which is running surgemail's avast upgrade code
3. Try running "avastvpsupdate.pl" which is running Alwil Software's script to do the same as surgemails update.

if "avastvpsupdate.pl" works but "./av_avast -update" does not, make sure the avast virus database file is owned by mail and not by root:

    root@netwin [/var/lib/avast4]# ls -l
    -rw-r--r--  1 mail mail 103866410 Oct 31 12:00 400.vps

### Avast status warning: n MESSAGES FAILED TO BE SCANNED AND BLOCKED

If you receive this warning on the advanced status page this means that you are running Avast antivirus and an error condition has been encountered that prevented the message from being scanned. The message will have been bounced and stored as avast_failureNN.msg for analysis.

You should first check that you do not have another realtime filesystem level virus scanner installed (such as Norton Antivirus). If you do, you need to prevent the avast temp directory ("_avast4_") from getting scanned. You will find this somewhere in a Windows temp folder like c:\windows\TEMP\_avast4_.

If you have checked the above and continue to receive this error, please report this to surgemail-support@netwinsite.com such that appropriate action can be taken (ie Netwin will report the problem to Alwil software).

### Automatic updates fail on scanning engine version 4.6 (linux)

If you are running engine version 4.6 getting errors in the log files along the lines of "vpipe failures 25 in a row av_avast" and / or "Avast initialisation failed, avworkInitialize returned 42000" then you must upgrade the avast engine as described here.

1. Download the updated Avast linux distribution (ftp://netwinsite.com/pub/surgemail/util/avast4surgemail_linux_engine470b.tar.gz).
2. Install the distribution by running the ./install.sh script and answering yes to all questions.

Here is a detailed example of this test and upgrade process.

Note: If the avast engine on linux continues to crash for you make sure you are running the 4.7 version of the scannign engine and not the 4.6 version.

To test which version of the scanning engine you are running against on linux, list the following file in your default libraries location:

eg: running against 4.7.0 version of scanning engine:

    [root@linux surgemail]# ls -l /usr/lib/libavastengine.so
    lrwxrwxrwx 1 root root 25 Jan 10 11:22 /usr/lib/libavastengine.so -> libavastengine-4.so.7.0.0

## Further Detail on SHM issue

Avast4Linux doesn't work with latest VPS (100328-1 and later)?

Here is advice from Alwil software's website on correcting this:

Starting with the 400.vps, version 100328-1, one of it's internal block reached the inner limit 33554432 bytes. It's a kernel variable which is (quite artificially) limiting the maximum size of any SHM memory block - and 33554432 was a default for some kernels.

Solution? Set the limit to higher values (as root):

    From command line type
    sysctl -w kernel.shmmax=128000000
    OR
    echo 128000000 >/proc/sys/kernel/shmmax

    Place those lines to /etc/init.d/rcS or equivalent file (it's a bit distribution-specific
    - see /etc/inittab, the sysinit runlevel) to have them set automatically (just after boot).

    Step by step:

    1.- Open terminal
    2.- Type: "sudo su" (then introduce your password)
    3.- Type: "echo 128000000 >/proc/sys/kernel/shmmax" (this will solve the problem in the current session).
    4.- Type: "gedit /etc/init.d/rcS"
    5.- Include the line as follows:
        #! /bin/sh
        #
        # rcS
        #
        # Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order
        #
        sysctl -w kernel.shmmax=128000000
        exec /etc/init.d/rc S
    6.- Save the file and that's all.