Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92879 - Clamd and freshclam ignoring options in /etc/conf.d/clamd
Summary: Clamd and freshclam ignoring options in /etc/conf.d/clamd
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Antivirus Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-17 02:28 UTC by Ed Wildgoose
Modified: 2005-05-17 07:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Wildgoose 2005-05-17 02:28:21 UTC
Using clamav-0.85-r1 (since the current stable versions moan that they are out
of date when updating defs..)

The current way that the /etc/init.d/clamd file is setup it seems to ignore
options set in /etc/conf.d/clamd.  At least in the default setup this means that
freshclam fails to start as a daemon and background itself and hence the restart
option won't execute correctly either

Can someone check this over because also when you background the process you no
longer get the return code which shows whether the DB is up to date, so that bit
of code needs to be removed as well.  Seems a bit of a mix right now?

Below is the diff of the changes I made which should work correctly when the
conf.d file specifies the "-d" option to run as a daemon.  Everything now starts
and stops correctly for me

--- /tmp/clamd.orig     2005-05-17 09:59:37.000000000 +0100
+++ /etc/init.d/clamd   2005-05-17 10:16:11.000000000 +0100
@@ -17,19 +17,17 @@
                fi
                ebegin "Starting clamd"
                start-stop-daemon --start --quiet \
-                       --exec /usr/sbin/clamd
+                       --exec /usr/sbin/clamd -- ${CLAMD_OPTS}
                eend $? "Failed to start clamd"
        fi
        if [ "${START_FRESHCLAM}" = "yes" ]; then
                ebegin "Starting freshclam"
                start-stop-daemon --start --quiet \
-                       --exec /usr/bin/freshclam
+                       --exec /usr/bin/freshclam -- ${FRESHCLAM_OPTS}
                retcode=$?
-               if [ ${retcode} = 1 ]; then
-                       eend 0
-                       einfo "Virus databases are already up to date."
-               else
+               if [ ${retcode} -ne 0 ]; then
                        eend ${retcode} "Failed to start freshclam."
+                       einfo "Failed to start freshclam"
                fi
        fi
 }



Reproducible: Always
Steps to Reproduce:
/etc/init.d/clamd restart
Comment 1 Andrej Kacian (RETIRED) gentoo-dev 2005-05-17 07:29:39 UTC
Please resync, I forgot to add the "-d" option to the initscript with initial
release of 0.85-r1. It was added one day later.

As for conf.d/ file, only START_CLAMD and START_FRESHCLAM options are being read
from it now, everything else should be read from /etc/clamd.conf and
/etc/freshclam.conf - this way there will not be any duplicate configuration,
which may clash (use one when user expects another to be used).

Sorry about the missing "-d" again.