Forums

Resolved
0 votes
This morning I've got an error from proxy server saying "Error: could not perform virus scan".
Doing some research I have found that there's been an upgrade of the "clearsdn-antimalware-6.1-20170209.1025.noarch" and "clearsdn-antispam-6.1-20170209.1025.noarch" packages. To my knowledge this was the only change made on the system from last night.
There are errors reported by dansguardian-av service - it cannot connect to /var/run/clamav/clamd.sock - indeed, no such file exists. No clamd.pid there either.
Trying to stop/start clamd.service using systemctl I got an error saying: "Job for clamd.service failed because a timeout was exceeded. See "systemctl status clamd.service" and "journalctl -xe" for details."
The service itself was in "activating" state - a clamd process was running. Since it failed to start, I've decided to run "systemctl stop clamd" and run it manually. Running "clamd restart" made it work again. I've tried restarting the server, tried to make the service run with systemd again and again with no luck.
Now, I run it manually, but I have to start it on my own if I restart the server.
There is no usefull info in the clamd.log file.
Can anyone help?
Friday, February 10 2017, 01:37 PM
Share this post:
Responses (5)
  • Accepted Answer

    Monday, March 20 2017, 07:24 AM - #Permalink
    Resolved
    2 votes
    An important update - if anyone hits this kind of a problem.

    What's been going on on my system was the systemd restarted clamd service due to timeouts. This went on for some time until systemd gave up and failed the service. After some time most other services that depend on clamd failed permanently aswell (in effect if I got clamd working, other services still did not run).

    There's a way to tell systemd to timeout after a specific amount of seconds.
    I've added a line:
    "TimeoutStartSec=600"
    to the clamd.service unit file inside /usr/lib/systemd/system/clamd.service

    Now the problem is solved for me.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, February 11 2017, 11:35 PM - #Permalink
    Resolved
    0 votes
    At least it could buy you time while you investigate... Never used slackware :-) Elegance is nice and can give great satisfaction, but with each component becoming more and more complex - the time it takes to fully comprehend each seems to be rising exponentially... Sometimes if you want a life "quick-n-dirty' has to suffice... If you find the problem or a 'delay' option in systemd - please update here...
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, February 11 2017, 11:19 PM - #Permalink
    Resolved
    0 votes
    Hi, Tony.

    Thanks for the tip. I will look into the systemd's framework to see what process is hogging the system and try to solve it there. I sure hope systemd is at such a stage in its development to offer some parameters for delayed service startups. Though that kinda beats its whole "run-everything-at-once" phylosophy. I might just be experiencing some expected side-effects which I have not seen before.
    I would just hate it going back to the "slackware"-like solutions, putting stuff inside rc.local. I'll give systemd a fighting chance this time ;).
    As far as the hw goes, It runs good enough once things settle down. I'm in no hurry to go shopping yet.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, February 11 2017, 10:54 PM - #Permalink
    Resolved
    0 votes
    If your system handles the load OK other than during a (re)boot - you could disable the 'heavy-hitter" daemons from automatically starting, and use entries in /etc/rc.d/rc.local to stagger start them after suitable delays using sleep. Just start them in the correct order... Something like

    sleep 180 && systemctl start xxx.service
    sleep 210 && systemctl start yyy.service
    etc

    However, if you need an excuse to buy new hardware - then by all means boost the economy :-)
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, February 11 2017, 03:18 PM - #Permalink
    Resolved
    0 votes
    Hi. Replying to my own issue.
    I've seen no apparent reason why clamd would work outside of systemd. However I have noticed that after I reboot Clearos server, its average load hits 10+. Observing things further, I've seen that systemd keeps restarting the service - I see clamd proces changing pid.
    My best guess is that the machine is just too busy starting all the services it has to restart clamd several times. I see a lot of cpu usage goes to clamscan after boot. This goes on for a few minutes then settles - afterwards the clamd service starts and everything works.

    It seems I will need to replace my hardware sometime soon. ;)
    The reply is currently minimized Show
Your Reply