#971842 clamav-daemon erroneously reports "Failed with result 'timeout'" when stopped

Package:
clamav-daemon
Source:
clamav
Description:
anti-virus utility for Unix - scanner daemon
Submitter:
dominik
Date:
2021-01-20 07:09:03 UTC
Severity:
minor
#971842#5
Date:
2020-10-08 12:47:28 UTC
From:
To:
Dear Maintainer,

when running "service clamav-daemon stop", an error gets reported in syslog:

systemd[1]: clamav-daemon.service: Failed with result 'timeout'.

This is unexpected. Stopping a service should not fail with a timeout
--- data dir ---
total 639012
-rw-r--r-- 1 clamav ssl-cert   1458176 Sep 19  2019 bytecode.cld
-rw-r--r-- 1 clamav ssl-cert 345477632 Oct  7 16:07 daily.cld
-rw-r--r-- 1 clamav ssl-cert 307403264 Nov 25  2019 main.cld
-rw------- 1 clamav ssl-cert      1920 Feb  9  2020 mirrors.dat

#971842#10
Date:
2020-11-01 14:29:21 UTC
From:
To:
I'm afraid I need some more information here.
My guess is that clamav-daemon is running. If you try to stop the
daemon, by the command you mentioned above, then it will send a SIGTERM
to the daemon and wait for the daemon to terminate. That timeout is
around one minute and twenty seconds. Plenty of time.
The `stop' command should not take that long. If that takes _long_ for
the daemon to process the signal it might be because it is swapped out.
But in that case it shouldn't be able to process scan requests in a
timely manner.
So I am puzzled what is going on.

Sebastian

#971842#15
Date:
2021-01-20 07:06:54 UTC
From:
To:
Dear Sebastian,

sorry for the late reply

most likely, the daemon is swapped out. We are talking about a memory
restricted system with the obligation to run daily scans on the file
system. It seems that running clamdscan with the daemon is still faster
while scanning the major part of the file system, compared to running
clamscan, even if the daemon uses some swap space.

Obviously, this setup is not optimal. I looked into running clamdscan
against a service on a different system in the same network, but this seems
not to be supported out of the box.

Would it hurt to increase the timeout or make it adjustable?

Dominik

Am Mi., 20. Jan. 2021 um 08:05 Uhr schrieb Dominik Reusser <
dr896543@gmail.com>: