You are not logged in.

#1 2014-12-16 09:12:14

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

[SOLVED] Error starting clamd

I am getting an error when systemd starts clamd (on a 1 minute timer)

Systemd reports the status as:

● clamd.service - clamav daemon
   Loaded: loaded (/etc/systemd/system/clamd.service; static)
   Active: failed (Result: exit-code) since Tue 2014-12-16 09:37:30 CET; 27min ago
  Process: 977 ExecStart=/usr/bin/clamd (code=exited, status=1/FAILURE)
 Main PID: 977 (code=exited, status=1/FAILURE)

Dec 16 09:37:01 hp-dm1 systemd[1]: Starting clamav daemon...
Dec 16 09:37:01 hp-dm1 systemd[1]: Started clamav daemon.
Dec 16 09:37:30 hp-dm1 clamd[977]: ERROR: TCP: getaddrinfo failed: Address family for hostname not supported
Dec 16 09:37:30 hp-dm1 systemd[1]: clamd.service: main process exited, code=exited, status=1/FAILURE
Dec 16 09:37:30 hp-dm1 systemd[1]: Unit clamd.service entered failed state.
Dec 16 09:37:30 hp-dm1 systemd[1]: clamd.service failed.

If I simply run "systemctl start clamd" it starts without any problem.

I googled "TCP: getaddrinfo failed:" but could not see anything that helped.

Does anyone know why I get an error the first time it tries to start?

Thanks

Andrew

Last edited by fdservices (2014-12-19 09:21:34)

Offline

#2 2014-12-18 04:53:59

CptnChristo
Member
Registered: 2014-09-22
Posts: 5

Re: [SOLVED] Error starting clamd

I'm not a systemd expert, but because nobody has responded...

From the error you quote, my instinct tells me that clamd is being started before the system has established networking support. Without networking support, the getaddrinfo request will always fail.

The fact that systemd can start the service after you log in also seems to support that idea.

This is the content of my unodified /usr/lib/systemd/system/clamd.service:

[Unit]
Description=clamav daemon

[Service]
Type=forking
PIDFile=/run/clamav/clamd.pid
ExecStart=/usr/bin/clamd

[Install]
WantedBy=multi-user.target

The "WantedBy" line points back to "multi-user.target" and digging further, "multi-user.target" wants "systemd-networkd.service" ... As I said, I'm no systemd expert, but I believe that interpretation is correct.

If you have modified your clamd.service file or created a custom timer, the networking dependency chain might be a good place to start.

I'd post the content of whatever systemd service/timer file you're working with just in case. I might not know systemd, but someone else here probably does.

Offline

#3 2014-12-19 09:17:15

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: [SOLVED] Error starting clamd

Thank you for pointing me in the right direction.

For some reason I had changed the service file. When I reinstated the old service file it all worked OK.


Andrew

Offline

#4 2014-12-19 11:07:50

fladi
Member
Registered: 2014-10-30
Posts: 19

Re: [SOLVED] Error starting clamd

Just out of curiousness - why do you use clamav ?

I use multiple laptops with Arch and Windows on it and also do I have a home server, so I installed f-prot, which in my personal opinion is far more better for detecting windows viruses than clamav and only runs in terminal (command line scanner without any gui).

To install it open terminal and type the following commands:

cd /opt/    (it is recommended to install f-prot in your /opt directory)

sudo wget http://files.f-prot.com/files/unix-tria … -ws.tar.gz (to fetch the latest version from the web)

sudo tar xfvz fp-Linux.x86.32-ws.tar.gz (to unpack the files)

cd /opt/f-prot/

sudo ./install-f-prot.pl (to run the installing procedure)

Then just hit enter all the time during installation process, this makes you take the default settings

To update you have to sudo /opt/f-prot/fpupdate (you see the update process in percentages afterwards - 100% means update done)

To scan and autorepair/delete infected files you have to sudo fpscan / -a -y --deleteall (scan whole harddrive with all archives, trying to repair, if impossible delete)

Thats it.

P.S. If you dont have multiarch repos enabled and/or no 32bit libraries you have to do this step before installing f-prot-

Enjoy.

Last edited by fladi (2014-12-21 05:56:51)

Offline

#5 2014-12-19 11:24:29

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: [SOLVED] Error starting clamd

Good tip. The answer is:

1)  I have to check for viruses because I have clients who use Windows
2)  I use thunderbird as my email client
3)  Clamav is the only virus checker that I have found that can check emails, as they come to thunderbird, for viruses via clamdrib.

You really should install f-prot from AUR though: https://aur.archlinux.org/packages/fprot/

Cheers

Andrew

Offline

#6 2015-06-18 06:06:37

djmsuman
Member
Registered: 2015-06-06
Posts: 4

Re: [SOLVED] Error starting clamd

Got these following error when I'm trying to start clamd.service

# systemctl status clamd.service
● clamd.service - clamav daemon
   Loaded: loaded (/usr/lib/systemd/system/clamd.service; enabled; vendor preset: disabled)
   Active: failed (Result: resources) since Thu 2015-06-18 11:31:44 IST; 3min 12s ago
  Process: 2052 ExecStart=/usr/bin/clamd (code=exited, status=0/SUCCESS)

Jun 18 11:31:32 djdext-linux.arch systemd[1]: Starting clamav daemon...
Jun 18 11:31:43 djdext-linux.arch clamd[2052]: ERROR: TCP: Cannot bind to [0.0.0.0]:3310: Address already in use
Jun 18 11:31:43 djdext-linux.arch clamd[2052]: ERROR: TCP: Cannot bind to [::]:3310: Address already in use
Jun 18 11:31:44 djdext-linux.arch systemd[1]: PID file /run/clamav/clamd.pid not readable (yet?) after start.
Jun 18 11:31:44 djdext-linux.arch systemd[1]: Failed to start clamav daemon.
Jun 18 11:31:44 djdext-linux.arch systemd[1]: Unit clamd.service entered failed state.
Jun 18 11:31:44 djdext-linux.arch systemd[1]: clamd.service failed.

Anyone please help. It takes a little bit time to delay startup routine or, boot up. sad

Last edited by djmsuman (2015-06-18 06:09:45)

Offline

#7 2015-06-18 06:46:36

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: [SOLVED] Error starting clamd

Without looking too deeply it sounds as if clamd has already started

ERROR: TCP: Cannot bind to [0.0.0.0]:3310: Address already in use

Check with

$ ps -el | grep clam

Andrew

Offline

Board footer

Powered by FluxBB