[clamav-users] Error: define server type (local and/or TCP). but LocalSocket is set

Scott Horton shorton at msxc.com
Fri Jul 22 17:17:20 UTC 2016


I finally got Postfix, Amavisd, Spamassassin and Clamd working together on
Centos7. Clamav from the Centos yum package.  These are the packages loaded:

clamav.x86_64                      0.99.2-1.el7                        @epel
clamav-data.noarch                 0.99.2-1.el7                        @epel
clamav-filesystem.noarch           0.99.2-1.el7                        @epel
clamav-lib.x86_64                  0.99.2-1.el7                        @epel
clamav-scanner.noarch              0.99.2-1.el7                        @epel
clamav-scanner-systemd.noarch      0.99.2-1.el7                        @epel
clamav-server.x86_64               0.99.2-1.el7                        @epel
clamav-server-systemd.noarch       0.99.2-1.el7                        @epel
clamav-update.x86_64               0.99.2-1.el7                        @epel

I wanted to reduce the timing that clamd does its Selfcheck abd discovered a
problem in the process.  I don't' think it was reading the config file I
thought it was reading.. 

My configuration file is located at
/etc/clamd.d/scan.conf
and, I also have /etc/clamd.conf linked to it.

I've changed the parameter in the conf file to
# Perform a database check.
# Default: 600 (10 min)
#SelfCheck 600
SelfCheck 3600

Restarted everything via systemctl to be sure (postfix, AMavisd, Clamd,
spamassassin).

But in my maillog, I still get the steady checks every 600 seconds:

Jul 21 21:15:24 tn4 clamd[3073]: SelfCheck: Database status OK.
Jul 21 21:25:24 tn4 clamd[3073]: SelfCheck: Database status OK.
Jul 21 21:35:24 tn4 clamd[3073]: SelfCheck: Database status OK.
Jul 21 21:45:24 tn4 clamd[3073]: SelfCheck: Database status OK.
Jul 21 21:55:24 tn4 clamd[3073]: SelfCheck: Database status OK.

I checked which service was actually running and that it is the only clamd
related process running:
clamd at amavisd.service loaded active running

I checked what I think is that configuration file for systemctl:
/usr/lib/systemd/system/clamd at .service
and it appers to be using the conf file I think it is:
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf --foreground=yes

Not sure what the %i resolves to. I think I saw that was amavisd somewhere.
Maybe the user that starts it?

So, I tried editing that service's starting file and manually pointing it to
start with "-c /etc/clamd.conf" That appears to made some difference, as it
moved the logging from maillog to /var/log/messages.

But now it says:
Jul 21 22:23:08 tn4 clamd: ERROR: Please define server type (local and/or
TCP).
Jul 21 22:23:08 tn4 systemd: clamd at amavisd.service: main process exited,
code=exited, status=1/FAILURE
Jul 21 22:23:08 tn4 systemd: Unit clamd at amavisd.service entered failed
state.
Jul 21 22:23:08 tn4 systemd: clamd at amavisd.service failed.

So I looked that up. My conf file does have the LocalSocket line uncommented
and a file defined:
# Default: disabled (must be specified by a user)
LocalSocket /var/run/clamd.amavisd/clamd.sock
I also have  PID defined.

I surmise from this that while I had clamd running without error, it was
apparently starting up with defaults and not using my config file.






More information about the clamav-users mailing list