ClamAVのインストール

○ClamAVのインストール
# yum -y install clamav clamd
# vi /etc/clamd.conf
 :
#LogSyslog yes ←コメントアウト
 :
TemporaryDirectory /tmp ←変更
 :
LocalSocket /var/run/clamav/clamd.socket ←変更
 :
#TCPSocket 3310 ←コメントアウト
 :
#TCPAddr 127.0.0.1 ←コメントアウト
 :
ScanPDF yes ←コメント解除
 :

# vi /etc/freshclam.conf
 :
#LogFileMaxSize 2M
LogFileMaxSize 0 ←変更
 :
# Use system logger (can work together with UpdateLogFile).
# Default: no
#LogSyslog yes ←コメントアウト
 :
#PidFile /var/run/freshclam.pid
PidFile /var/run/clamav/freshclam.pid ←変更
 :
#AllowSupplementaryGroups yes
AllowSupplementaryGroups yes ←コメント解除
 :

# vi /etc/rc.d/init.d/freshclam ←作成

#! /bin/bash
#
# freshclam Start/Stop the freshclam daemon.
#
# chkconfig: - 71 40
# description: freshclam is an update daemon for Clam AV database.
#
# processname: freshclam
# config: /etc/freshclam.conf
# pidfile: /var/run/clamav/freshclam.pid

# Source function library
. /etc/init.d/functions

# Get network config
. /etc/sysconfig/network

RETVAL=0

# See how we were called.

prog="freshclam"
progdir="/usr/bin"

start() {
echo -n $"Starting $prog: "
daemon $progdir/$prog -d
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/freshclam
return $RETVAL
}

stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/run/clamav/freshclam.pid /var/lock/subsys/freshclam
return $RETVAL
}

restart() {
stop
start
}

reload() {
echo -n $"Reloading DB: "
killproc freshclam -ALRM
RETVAL=$?
echo
return $RETVAL
}

case "$1" in
start)
start
;;
stop)
stop
;;
status)
status freshclam
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/freshclam ] && restart || :
;;
reload)
reload
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
exit 1
esac

exit $?

# chmod 755 /etc/rc.d/init.d/freshclam
# chkconfig freshclam on

# service freshclam start
# service clamd start