1

Topic: clamd: ERROR: Can't open/parse the config file /etc/clamd.d/ama...

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.3
- Linux/BSD distribution name and version: Centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): apache
- Manage mail accounts with iRedAdmin-Pro? No, iRedADmin
- Related log if you're reporting an issue:

In /var/log/messages I see this:

Jan 13 22:28:20  fail2ban.jail[1005]: INFO Jail 'sshd-ddos' started
Jan 13 22:28:20  systemd: clamd@amavis.service holdoff time over, scheduling restart.
Jan 13 22:28:20  systemd: Started clamd scanner (amavis) daemon.
Jan 13 22:28:20  systemd: Starting clamd scanner (amavis) daemon...
Jan 13 22:28:20  clamd: ERROR: Can't open/parse the config file /etc/clamd.d/amavis.conf
Jan 13 22:28:20  systemd: clamd@amavis.service: main process exited, code=exited, status=1/FAILURE
Jan 13 22:28:20  systemd: Unit clamd@amavis.service entered failed state.
Jan 13 22:28:20  systemd: clamd@amavis.service failed.
Jan 13 22:28:21  fail2ban.jail[1005]: INFO Jail 'apache-auth' started
Jan 13 22:28:21  systemd: clamd@amavis.service holdoff time over, scheduling restart.
Jan 13 22:28:21  systemd: Started clamd scanner (amavis) daemon.
Jan 13 22:28:21  systemd: Starting clamd scanner (amavis) daemon...
Jan 13 22:28:21  clamd: ERROR: Can't open/parse the config file /etc/clamd.d/amavis.conf
Jan 13 22:28:21  systemd: clamd@amavis.service: main process exited, code=exited, status=1/FAILURE

====

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: clamd: ERROR: Can't open/parse the config file /etc/clamd.d/ama...

I think the problem is in here:

cat /usr/lib/systemd/system/clamd@.service
[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
[Install]
WantedBy=multi-user.target

Maybe this is a bug, I didn't touch anything, server is two weeks old.

Also I have bash_completion and when I do systemctl status clamd(TAB TAB) I see this:
clamd@amavisd.service  clamd@amavis.service 

And this systemctl status clamd@amavisd.service  reports active runing. But:
systemctl status clamd@amavis.service reports Failed
● clamd@amavis.service - clamd scanner (amavis) daemon
   Loaded: loaded (/usr/lib/systemd/system/clamd@.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Wed 2016-01-13 22:28:21 CET; 23h ago
  Process: 2184 ExecStart=/usr/sbin/clamd -c /etc/clamd.d/%i.conf --nofork=yes (code=exited, status=1/FAILURE)
Main PID: 2184 (code=exited, status=1/FAILURE)

Why there are two services? The clamd@amavisd.service  you created from clamd@amavis.service?
If I search for  clamd@amavisd.service and clamd@amavis.service only one is found so I don't get where the second one is picked by systemd?

locate clamd@amavis.service - NOTHING
locate clamd@amavisd.service
/etc/systemd/system/multi-user.target.wants/clamd@amavisd.service

3

Re: clamd: ERROR: Can't open/parse the config file /etc/clamd.d/ama...

Show us output of command below:

ls -l /etc/clamd.d/

4 (edited by Clouseau 2016-01-17 00:27:41)

Re: clamd: ERROR: Can't open/parse the config file /etc/clamd.d/ama...

Yeah, that's the first thing I looked:

-rw-r--r-- 1 root root 548 Jan  6 15:33 amavisd.conf
-rw-r--r-- 1 root root 546 Jan  6 15:33 amavisd.conf.2016.01.06.15.30.12

Btw I do not see anything in logs yestarday and today... Last entry was on
Jan 13 22:28:21  systemd: Starting clamd scanner (amavis) daemon...
Jan 13 22:28:21 clamd: ERROR: Can't open/parse the config file /etc/clamd.d/amavis.conf

EDIT: Ok, this is shown in logs only on system startup(after restart) so it is picked up with logwatch.

5

Re: clamd: ERROR: Can't open/parse the config file /etc/clamd.d/ama...

Clouseau wrote:

And this systemctl status clamd@amavisd.service  reports active runing.

This is a bug of iRedMail. It enables both 'clamd' and 'clamd@amavisd' on CentOS 7.
I fixed this moment ago by disabling 'clamd' explicitly,  and keep 'clamd@amavisd' enabled. so next iRedMail release won't have this issue anymore.