bugette in ASL clamd.conf in Centos 7

Forum for getting help with Project Gamera, Spamassassin, Clamav, qmail-scanner and other anti-spam tools.
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

bugette in ASL clamd.conf in Centos 7

Unread post by faris »

I think I found a minor bug in the clamav rpm from the ASL repo for Centos 7

Once installed, in /etc/clamd.conf the path to the pid file is wrong (or the install script is missing a line to create the require directory)

Original, as installed:
# This option allows you to save a process identifier of the listening
# daemon (main thread).
# Default: disabled
PidFile /var/run/clamav/clamd.pid

But there is no /var/run/clamav directory.

So either that has to be created, or the config needs to be changed to
PidFile /var/run/clamd.pid


Without the fix, systemctl status clamd shows an error about the pid not being written

*****

In addition, something strange is going on with the socket file. The default is /tmp/clamd.socket but it never shows up.
If you change it to /var/run/clamd.socket it appears.
I don't quite know what's going on there. This may be system configuration specific.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: bugette in ASL clamd.conf in Centos 7

Unread post by faris »

Errr... there's more to this than meets the eye, it seems.

It looks as though /var/run is ephemeral on the particular configuration of Centos 7 that I am testing with.

Thus anything that creates /var/run/whatever at application install time but does not re-create at boot/restart is going to stop working if it needs to write a .pid file or whatever to a directory under /var/run/
So that's psa-proftpd, clamd and a few other things.

From what I can figure out, this is not something that should necessarily be happening.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: bugette in ASL clamd.conf in Centos 7

Unread post by faris »

And in fact I was wrong about it being atypical.

From what I'm seeing online, /run (/var/run) is mounted on tempfs in Centos 7 / RH7 as standard, so it will get wiped on reboot.

So any application that is configured to create /var/run/specific-directory/ during installation but not to re-create it if required during startup/restart will throw errors after a reboot.

This specifically includes clamd from the ASL repo, and psa-proftp from the Atomic/ASL repo.

There may be others.

IN ADDITION, I'm seeing gosh darned weird stuff happening with rsyslogd not logging as expected. This may be related to a timing bug mentioned somewhere or other, because following the instructions to fix it certainly makes logging burst into life.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: bugette in ASL clamd.conf in Centos 7

Unread post by prupert »

This is a bug in the package from Atomic.

A package should never manually create files or directories in /run (or /var/run, which is a symlink to /run) on installation. Systemd with tmpfiles is the way to go, see "man tmpfiles.d".
Lemonbit Internet Dedicated Server Management
Post Reply