Bug 25315 - clamd.service cannot be started
Summary: clamd.service cannot be started
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 6
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: All Packagers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-16 12:44 CEST by Zoltan Balaton
Modified: 2019-11-26 15:50 CET (History)
2 users (show)

See Also:
Source RPM: clamav-0.100.3-1.mga6.src.rpm
CVE:
Status comment:


Attachments

Description Zoltan Balaton 2019-08-16 12:44:35 CEST
After reboot or systemctl restart clamd.conf it starts briefly but enters failed state after a timeout. After the systemctl restart times out systemctl status says:

clamd.service - Clam AntiVirus Daemon is a TCP/IP or unix domain
   Loaded: loaded (/usr/lib/systemd/system/clamd.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout)
  Process: 1447 ExecStart=/usr/sbin/clamd --config-file=/etc/clamd.conf (code=killed, signal=TERM)

systemd[1]: Starting Clam AntiVirus Daemon is a TCP/IP or unix domain...
systemd[1]: clamd.service: Start operation timed out. Terminating.
systemd[1]: Failed to start Clam AntiVirus Daemon is a TCP/IP or unix domain.
systemd[1]: clamd.service: Unit entered failed state.
systemd[1]: clamd.service: Failed with result 'timeout'.

Looking at the process list during systemctl start is not yet timed out I see:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      1923  0.0  0.0  21652  2444 pts/0    S+   12:06   0:00  |                   systemctl start clamd.service
root      1924  0.0  0.0   8544  1532 pts/0    S+   12:06   0:00  |                       \_ /usr/bin/systemd-tty-ask-password-agent --watch
clamav    1925  100 12.6 452812 388372 ?       Rs   12:06   0:34 /usr/sbin/clamd --config-file=/etc/clamd.conf

In clamav.log I see when failed:

Fri Aug 16 12:06:09 2019 -> +++ Started at Fri Aug 16 12:06:09 2019
Fri Aug 16 12:06:09 2019 -> Received 0 file descriptor(s) from systemd.
Fri Aug 16 12:06:09 2019 -> clamd daemon 0.100.3 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Fri Aug 16 12:06:09 2019 -> Log file size limited to 2097152 bytes.
Fri Aug 16 12:06:09 2019 -> Reading databases from /var/lib/clamav
Fri Aug 16 12:06:09 2019 -> Not loading PUA signatures.
Fri Aug 16 12:06:09 2019 -> Bytecode: Security mode set to "TrustSigned".

When starting manually:

Fri Aug 16 12:13:13 2019 -> Not loading PUA signatures.
Fri Aug 16 12:13:13 2019 -> Bytecode: Security mode set to "TrustSigned".
Fri Aug 16 12:15:11 2019 -> Loaded 6280332 signatures.
[...]
Fri Aug 16 12:15:13 2019 -> Listening daemon: PID: 2119

So it takes about 2 minutes to load signatures and start, is the timeout in the systemd unit sufficient for that?

It also complains on freshclam updates that version is outdated so some signatures may not work so maybe package sould also be updated to latest clamav release.
Comment 1 Lewis Smith 2019-08-16 21:15:00 CEST
Thank you Zoltan for all the well judged information you provided.

Assigning globally as there is no registered maintainer; CC'ing ThomasS as he has seen this often in the rather distant past (sorry if this is not appropriate).

CC: (none) => thomas
Assignee: bugsquad => pkg-bugs

Comment 2 Zoltan Balaton 2019-08-16 22:49:34 CEST
To fix this locally I've added TimeoutStartSec=180 to the [Service] section of /usr/lib/systemd/system/clamd.service

I'm not sure about the best value for timeout though as it could take longer on a slower or more busy machine. Maybe something like 5 minutes should be enough even if later updates increase startup time but I let you judge this.
Comment 3 David Walser 2019-08-18 16:30:13 CEST
Thomas passed away.  It looks like Nicolas has been the de-facto maintainer.

CC: thomas => nicolas.salguero

Comment 4 Lewis Smith 2019-08-19 19:51:38 CEST
I feel bad about the gaff. Thanks for putting it right.
Comment 5 Nicolas Salguero 2019-11-26 15:08:00 CET
Mageia 6 is EOL.

Status: NEW => RESOLVED
Resolution: (none) => OLD

Comment 6 David GEIGER 2019-11-26 15:33:03 CET
(In reply to Nicolas Salguero from comment #5)
> Mageia 6 is EOL.

Is this issue fixed in mga7 and Cauldron?

CC: (none) => geiger.david68210

Comment 7 Nicolas Salguero 2019-11-26 15:50:07 CET
Yes, I forgot to say that, in my tests, I cannot reproduce the problem in mga7 for instance.

Note You need to log in before you can comment on or make changes to this bug.