Hi All,
I am using clamav, running clamd under daemontools, version 0.70rc on
FreeBSD 4.7, my run script is at the end...  Clamd is being called from
qmail-scanner 1.21

What is odd is every once in a while I notice the processor hit 100% with
clamd using it all.  This continues for 5, 10 or even 15 minutes sometimes
and if I go to my /var/spool/qmailscan/working/new folder (where the files
are stored as clamd is working on them) the files is sometimes only 5K in
size?  I could understand this happening once in a while on a LARGE email,
but it seems to happen more often on smaller emails and I am now seeing it
many times per day?

I can't seem to figure out what is going on at that time, why so long, and
why so much CPU?  My clamd.log looks normal, just plugging away, can I
somehow turn on a debug feature or something to see what it is working so
hard on?

Should I update to the latest CVS for any reason?

Best Regards and Thanks!
Shannon
http://www.battcave.com


Clamd run script:

#!/bin/sh
#
# --------------------------------------------------
# run
#
# Purpose     - Start the clamd daemon/service.
#                               
# Author      - Jesse D. Guardiani
# Created     - 09/10/03
# Modified    - 09/25/03
# --------------------------------------------------
# This script is designed to be run under DJB's
# daemontools package.
#         
#  ChangeLog
#  ---------
#
#  09/25/03 - JDG
#  --------------
#  - Changed clamd user to qscand in compliance with
#    the change to qmail-scanner-1.20rc3
#
#  09/10/03 - JDG
#  --------------
#  - Created
# --------------------------------------------------
# Copyright (C) 2003 WingNET Internet Services
# Contact: Jesse D. Guardiani (jesse at wingnet dot net)
# --------------------------------------------------

lockfile="/tmp/clamd"   # Location of clamd lock file
path_to_clamd="/usr/local/sbin/clamd"
                        # Location of the clamd binary
BAD_EXIT_CODE=1         # The exit code we use to announce that something
bad has happened

# The following pipeline is designed to return the pid of each
# clamd process currently running.
get_clam_pids_pipeline=`ps -ax | grep -E "${path_to_clamd}\$" | grep -v grep
| awk '{print $1}'`


# --------------------------------------------------
# Generic helper functions
# --------------------------------------------------

# Basic return code error message function
die_rcode() {
        EXIT_CODE=$1
        ERROR_MSG=$2

        if [ $EXIT_CODE -ne '0' ]; then
                echo "$ERROR_MSG" 1>&2
                echo "Exiting!" 1>&2
                exit "$BAD_EXIT_CODE"
        fi
}


# --------------------------------------------------
# Main
# --------------------------------------------------

ps_clamd=""
ps_clamd="$get_clam_pids_pipeline"

if [ -n "$ps_clamd" ]; then
        pid_count="0"
        for pid in $ps_clamd
        do
                pid_count=`expr $pid_count + 1`
        done

        die_rcode $BAD_EXIT_CODE "Error: $pid_count clamd process(es)
already running!"

fi

if [ -e "$lockfile" ]; then
        rm "$lockfile"
        exit_code="$?"
        die_rcode $exit_code "Error: 'rm $lockfile' call failed."
fi

exec /usr/local/bin/setuidgid qscand $path_to_clamd



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to