<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 9/19/2012 3:36 PM, Arthur Dent
      wrote:<br>
    </div>
    <blockquote cite="mid:1348083388.2123.17.camel@localhost"
      type="cite">
      <pre wrap="">On Wed, 2012-09-19 at 10:47 +0100, Arthur Dent wrote:
</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">"What tells it that it is a "scan" service? That bit of the puzzle seems
to be missing..."

Whatever is the parameter after the @ and before the dot  becomes %i in
the service file.  Look at the service file:
[Unit]
Description = clamd scanner (%i) daemon
After = syslog.target nss-lookup.target network.target

[Service]
Type = simple
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf --nofork=yes
Restart = on-failure
PrivateTmp = true

so <a class="moz-txt-link-abbreviated" href="mailto:clamd@scan.service">clamd@scan.service</a> invokes clamd with the scan.conf file as it's
configuration file.
This way you can have multiple clamd services each using a different
config file.  Just create another config file in
/etc/clamd.d/my_config.conf and:
ln -s /lib/systemd/system/clamd@.service
/etc/systemd/system/clamd@my_config.service

You should have the /etc/clamd.d/scan.conf I think:

[root@moses shorewall]# rpm -qf /etc/clamd.d/scan.conf
clamav-scanner-0.97.5-1700.fc17.noarch
</pre>
        </blockquote>
        <pre wrap="">
Thank you Bill for a helpful and, more importantly, informative reply. I
think this will not only help me to solve my problem but, even better,
help me to understand where I was going wrong.

As before, I don't have access to the machine right now, so i will try
when I get home to work through this and get it right.

I will once again report back later...
</pre>
      </blockquote>
      <pre wrap="">
Well... Progress!

Because I have done so much tinkering and editing of configs (and had
previously even tried the script I mentioned earlier) I was unsure as to
what should be where, so I blitzed every clam* package with yum erase,
ran updatedb and then deleted any and all clam* files and directories
still left. I also deleted the clam* users that had been created
(including a "clamd user that I had created myself), and then
reinstalled the lot.

A quick edit of the freshclam configs and the /etc/clamd.d/scan.conf
file and a call to systemctl enable <a class="moz-txt-link-abbreviated" href="mailto:clamd@scan.service">clamd@scan.service</a> and systemctl
start <a class="moz-txt-link-abbreviated" href="mailto:clamd@scan.service">clamd@scan.service</a> and I am up and running!

Thank you so much.

All is not _quite_ perfect however. In calling clamdscan from my script
(itself called from procmail) I get the error:
ERROR: Can't parse clamd configuration file /etc/clamd.conf

Note the config file and location. In order to get it to work (which it
does), I need to declare clamdscan in my script as:
"/bin/clamdscan -c/etc/clamd.d/scan.conf"

So where does it default to /etc/clamd.conf ? I have grepped the whole
of /etc/* and can't find a reference to this location, and there is
no /etc/sysconfig/clamd as there used to be.

I think this is the last remaining mystery. After I have solved this I
will be a very happy bunny!

Thank you again.

Mark



</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    /etc/clamd.conf is the old location for the config file.  With the
    flexibility of systemd allowing multiple daemons running, I think
    the packager changed things to use /etc/clam.d/scan.conf but didn't
    catch this change for clamdscan.<br>
    <br>
    I also run a Mandriva mail server that uses procmail to deliver
    mail.  Here is a snippet of my IMAP recipe:<br>
    :0<br>
    VIRUS=| clamdscan --no-summary --stdout - | cut -d' ' -f2 -<br>
    <br>
    :0<br>
    * VIRUS ?? !^Can\'t<br>
    {<br>
      :0<br>
      * VIRUS ?? !^OK<br>
      {<br>
        :0<br>
        SUBJECT=| egrep '^Subject:' - | sed -e 's/Subject: //' -<br>
        :0 fw<br>
        | formail -i "Subject: [VIRUS: ${VIRUS}] ${SUBJECT}" -I
    "X-Clamav-Virus-Detected: Yes, ${VIRUS}"<br>
        :0<br>
        $DEFAULT.SystemFolders.Infected/<br>
      }<br>
    <br>
      :0Efw<br>
      | formail -b -f -t -I "X-Clamav-Virus-Detected: No"<br>
    }<br>
    <br>
    To be honest, I don't remember what all the commands do except when
    it detects a spam email it puts it in a different directory
    ($DEFAULT.SystemFolders.Infected/).  This Mandriva server uses
    /etc/clamd.conf.<br>
    <br>
    Bill<br>
    <br>
  </body>
</html>