Installation guide for DCCifd

Installing DCC as a daemon.

Preface

The DCCproc, which is the non-daemon version of DCC, requires to load code every time a batch of messages is processed.

DCCifd, on the other hand, is the daemon of DCC, which takes a constant amount of RAM once loaded, but there is no need to load it at every batch.

So, if you use MailScanner on a low scale mail server, or even as a one user’s solution, it’s better that you run it as DCCproc.

If your mailserver scans loads of messages each day, then it’ll probably be better to run it as a daemon.

From DCC’s web site:

Dccifd(8) is similar to dccproc but is not run separately for each mail
     message and so is far more efficient.  It receives mail messages via a
     socket somewhat like dccm, but with a simpler protocol that can be used
     by Perl scripts or other programs.

Vernon Schryver 

Preface Update

I (Ugo) asked on the DCC list why DCCifd was faster than dccproc. DCC’s author answered:

dccproc involves a fork() and exec() and then sending the message through
a pipe to the child process and receiving the answer.
dccifd need only send the message over UNIX domain socket to a daemon
and receiving the answer.

Dccproc must open, validate, and mmap() the whiteclnt and whiteclnt.dccw
files, while dccifd caches open files and mmap() regions.
Dccproc also creates creates a socket to talk to the DCC server while
dccifd caches open sockets. 

This document goes through the procedure of installing DCC as a daemon on RedHat 9.0 or Fedora Core 1, as these are the systems we’ve got at hand. However, changing it to fit any and all linux distributions should be quite easy, especially for the non-newbies amongst us.

Level 2 Headline

Installation

First, I assume you’ve downloaded dcc-dccd.tar.Z from DCC

First you need to unpack it. let’s assume you’ve downloaded it into /home/user

don’t forget to su to root

[root@squid]# cd /usr/local/src
[root@squid]# tar -zxvf /home/user/dcc-dccd.tar.Z
[root@squid]# cd dcc-dccd-1.2.36
[root@squid]# ./configure
[root@squid]# make
[root@squid]# make install ''

This all assume that you’ve got the gcc cc compiler installed. If you don’t know what this means, but did a full install of the OS, don’t worry, it should work.

Now, go into /etc/MailScanner/MailScanner.conf

[root@squid]# vi /etc/MailScanner/MailScanner.conf

find the Debug lines and set both MailScanner and SpamAssassin to debug=yes save the file and issue a

[root@squid]# service MailScanner restart 

Look at the output. You should see a line stating that DCC was found and a linestating that DCCifd was not (something along the lines of DCCifd is not 
available: no r/w dccifd socket found).  This means that DCC is installed.We're halfway there.
Now that we've got DCC working in batches (dccproc) (meaning it will be launched every scanned batch of messages) we need to configure it to be a daemon. 
<code>
[root@squid]# cd /var/dcc
[root@squid]# vi dcc_conf 

locate the line stating

DCCIFD_ENABLE=off

and replace it with

DCCIFD_ENABLE=on

Also, go into /etc/MailScanner/spam.assassin.prefs.conf and add the line

dcc_home /var/dcc

save the file and exit.

Making it start a boot

ORGINAL WAY

[root@squid]# cd /var/dcc/libexec
[root@squid]# cp rcDCC /etc/rc.d/init.d/DCC 

Ok, now all we need to do is make sure that this service starts when the operating system does.

ALTERNATIVE WAY

[root@squid]# ln -s /var/dcc/libexec/rcDCC /etc/rc.d/init.d/DCC

Just use chkconfig to add DCC to runlevels 2,3,4,5 you can make another selection of runlevels afterwards.

[root@squid]# chkconfig –-add DCC

Final checks

Now we need to reboot to see if it actually starts up at boot

[root@squid]# reboot

once the system has reloaded, verify that the DCCifd service has started

[root@squid]# ps -ax | grep DCC

another way to verify this is to run

[root@squid]# netstat -l

and look for a line saying something along these lines

unix 2 [ ACC ] STREAM LISTENING 643260 /var/dcc/dccifd

this means that the service is running.

One last thing is to make sure that MailScanner is using it. You can go into /var/log/maillog to check this, or start MailScanner in Debug mode and look at the output.

If the output says that

debug: DCCifd is available: /var/dcc/dccifd

then we’re home free.

As you can see, the DCCproc is no longer used; you don’t have to explicitly tell MailScanner to not use it. If DCCifd (the daemon) is available then MailScanner uses it and not DCCproc. If DCCifd is not available, it will fallback to dccproc and use it.

This howto has been developed by Ugo Bellavance and Tomer Shoval, then written by Tomer and revised by Ugo.

We haven’t tested a lot, so we can’t tell for now the difference in performance. If you do, please let us know by adding to this faq you findings. Thanks!

EXTRA:

Add a cron job to /var/dcc/libexec/updatedcc weekly. This will download the latest version of the package, compile and install it.

Important:

To the maintenance.

SOLARIS Extra Instructions

The instruction also applies to Solaris but instead of chkconfig you do:

# cp /var/dcc/libexec/rcDCC /etc/init.d/dcc
# cd /etc/rc2.d
# ln -s ../init.d/dcc S89dcc
# cd ../rc1.d
# ln -s ../init.d/dcc K35dcc

No need to reboot. Just start it with:

# /etc/rc2.d/S89dcc start

Check for it with:

# ps -ef | grep dcc
root 12426     1  0 16:42:59 ?        0:00 /var/dcc/libexec/dccifd 
-R @dcc_rundir@ -l log -t CMN,5, -w whiteclnt -U userdi
# netstat -a | grep dcc
30001f611d8 stream-ord 3000207cca0 00000000 /var/dcc/dccifd
# ls -l /var/dcc/dccifd
srw-rw-rw-   1 root     other          0 Apr 14 16:42 dccifd
 
documentation/anti_spam/spamassassin/plugins/dcc/dccifd_install.txt · Last modified: 2006/10/31 22:51 by ugob
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki