Difference between revisions of "Clamav"

From CBLFS
Jump to navigationJump to search
(New page: {| style="text-align: left; background-color: AliceBlue;" |- !Download Source: | http://downloads.sourceforge.net/clamav/clamav-{{Clamav-Version}}.tar.gz |} ---- {{Package-Introduction|C...)
 
Line 90: Line 90:
  
 
=== Bootscript ===
 
=== Bootscript ===
 +
 +
Create the bootscript:
 +
 +
cat > /etc/rc.d/init.d/clamav << "EOF"
 +
#!/bin/sh
 +
# Begin $rc_base/init.d/clamav
 +
 +
. /etc/sysconfig/rc
 +
. ${rc_functions}
 +
 +
case "${1}" in
 +
        start)
 +
                boot_mesg "Starting ClamAV Daemon..."
 +
                loadproc /usr/sbin/clamd
 +
                ;;
 +
 +
        stop)
 +
                boot_mesg "Stopping ClamAV Daemon..."
 +
                killproc /usr/sbin/clamd
 +
                ;;
 +
 +
        restart)
 +
                ${0} stop
 +
                sleep 1
 +
                ${0} start
 +
                ;;
 +
 +
        status)
 +
                statusproc /usr/sbin/clamd
 +
                ;;
 +
 +
        *)
 +
                echo "Usage: ${0} {start|stop|restart|status}"
 +
                exit 1
 +
                ;;
 +
esac
 +
 +
# End $rc_base/init.d/clamav
 +
EOF
 +
chmod -v 754 /etc/rc.d/init.d/clamav
 +
 +
Link it into the runlevels:
 +
 +
for link in /etc/rc.d/rc{{0,1,6}.d/K32,{2,3,4,5}.d/S18}clamav; do
 +
  ln -sfv ../init.d/clamav $link;
 +
done
  
 
== Contents ==
 
== Contents ==

Revision as of 12:34, 8 July 2008

Download Source: http://downloads.sourceforge.net/clamav/clamav-0.96.tar.gz

Introduction to Clamav

Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX, designed especially for e-mail scanning on mail gateways.

Project Homepage: http://www.clamav.org/


Dependencies

Optional

Creating the clamav User & Group

groupadd -g 36 clamav &&
useradd -c "Clam AntiVirus Daemon" -d /dev/null \
       -u 36 -g clamav -s /bin/false clamav

Non-Multilib

Compile the package:

./configure --prefix=/usr --sysconfdir=/etc \
     --with-zlib=/usr --with-dbdir=/var/lib/clamav &&
make

Install the package:

make install

Multilib

32Bit

Compile the package:

To do ...

Install the package:

To do ...

N32

Compile the package:

To do ...

Install the package:

To do ...

64Bit

Compile the package:

To do ...

Install the package:

To do ...

Configuring

Editing the clamd.conf file

Edit the /etc/clamd.conf and remove or comment the line where "Example" is writed.

Editing the freshclam.conf file

Edit the /etc/freshclam.conf file and remove or comment the line where "Example" is writed.

Edit the DatabaseDirectory to say where freschlam must find the virus databases following :

DatabaseDirectory /var/lib/clamav

Creating the freshclam.log file

This file is necessary for updating the virus databases, create it and change permissions following :

touch /var/log/freshclam.log &&
chmod 600 /var/log/freshclam.log &&
chown clamav /var/log/freshclam.log

Bootscript

Create the bootscript:

cat > /etc/rc.d/init.d/clamav << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/clamav

. /etc/sysconfig/rc
. ${rc_functions}

case "${1}" in
        start)
                boot_mesg "Starting ClamAV Daemon..."
                loadproc /usr/sbin/clamd
                ;;

        stop)
                boot_mesg "Stopping ClamAV Daemon..."
                killproc /usr/sbin/clamd
                ;;

        restart)
                ${0} stop
                sleep 1
                ${0} start
                ;;

        status)
                statusproc /usr/sbin/clamd
                ;;

        *)
                echo "Usage: ${0} {start|stop|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/clamav
EOF
chmod -v 754 /etc/rc.d/init.d/clamav

Link it into the runlevels:

for link in /etc/rc.d/rc{{0,1,6}.d/K32,{2,3,4,5}.d/S18}clamav; do
  ln -sfv ../init.d/clamav $link;
done

Contents

Installed Directories: /var/lib/clamav
Installed Programs: clamscan, clamd, freshclam, sigtool, clamconf, clamav-config
Installed Libraries: libclamunrar.{a,la,so}, libclamunrar_iface.{a,la,so}, libclamav.{a,la,so}