You are not logged in.

#1 2020-11-21 19:24:01

Hamsterkill
Member
Registered: 2009-05-05
Posts: 67

clamav-clamonacc won't start

When I try to start the clamav-clamonacc service after doing the suggested configuration of clamd.conf, it fails with the following reason in journalctl:

ERROR: Clamonacc: can't parse clamd configuration file @APP_CONFIG_DIRECTORY@/clamd.conf

The clamav service itself runs fine, so I don't see how it could be a syntax error of the clamd.conf file. Is it just not finding the configuration file due to that "@APP_CONFIG_DIRECTORY@"? How can I resolve this?

Offline

#2 2020-11-22 13:40:09

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: clamav-clamonacc won't start

https://wiki.archlinux.org/index.php/Cl … AccessScan indicates you're not supposed to start that service directly.

After configuring /etc/clamav/clamd.conf , try restarting clamav-daemon.service


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2020-11-22 22:18:25

Hamsterkill
Member
Registered: 2009-05-05
Posts: 67

Re: clamav-clamonacc won't start

Lone_Wolf wrote:

https://wiki.archlinux.org/index.php/Cl … AccessScan indicates you're not supposed to start that service directly.

After configuring /etc/clamav/clamd.conf , try restarting clamav-daemon.service

That section is marked as outdated, so I was following the upstream: https://www.clamav.net/documents/on-access-scanning

For what it's worth, the clamav-daemon service has been restarted several times since I made the configuration changes.

Last edited by Hamsterkill (2020-11-22 22:25:40)

Offline

#4 2020-11-23 11:04:27

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: clamav-clamonacc won't start

The upstream doc doesn't mention using systemd services at all, it expects users to manually start clamav / clamav-onaccess .

Have you tried disabling all clamav services and starting things manually as that guide suggests to verify that method works ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2020-11-24 12:50:09

Hamsterkill
Member
Registered: 2009-05-05
Posts: 67

Re: clamav-clamonacc won't start

Lone_Wolf wrote:

The upstream doc doesn't mention using systemd services at all, it expects users to manually start clamav / clamav-onaccess .

Have you tried disabling all clamav services and starting things manually as that guide suggests to verify that method works ?

The upstream documentation is presumably written that way as clamav, itself, supports non-systemd systems. It's not unusual for upstream documentations to be written in an agnostic way. Being an Arch user, translating that into systemd terms isn't usually that difficult. Here, it seems pretty clear that the clamav-clamonacc service is meant for the use of clamonacc.

To answer your question, clamonacc does start when run with

sudo clamonacc

-- which is to say it doesn't throw a parsing error as above. Though it seems unable to scan anything due to "Permission denied" errors.

EDIT: I should note that clamdscan has been unable to scan anything due to permission errors as well, whether or not clamd is started with systemd or manually. I'm guessing that's indicating the clamav user is misconfigured, but that's a separate issue from why the clamonacc service isn't starting.

EDIT2: Figured out the permission issue requires the use of --fdpass when running clamdscan or clamonacc. Clamonacc (when run manually) still can't successfully scan anything due to socket issues that appear to be the result of a bug in clamav currently.

I also looked into the clamonacc service. It seems that "@APP_CONFIG_DIRECTORY@" is some kind of variable meant to be replaced when the package is built, but that's not happening. I'll file a bug on Arch for it.

Last edited by Hamsterkill (2020-11-24 14:01:53)

Offline

#6 2020-11-24 13:54:37

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: clamav-clamonacc won't start

well, here's the service in question

# clamonacc systemd service file primarily the work of ChadDevOps & Aaron Brighton
# See: https://medium.com/@aaronbrighton/installation-configuration-of-clamav-antivirus-on-ubuntu-18-04-a6416bab3b41#a340

[Unit]
Description=ClamAV On-Access Scanner
Documentation=man:clamonacc(8) man:clamd.conf(5) https://www.clamav.net/documents
Requires=clamav-daemon.service
After=clamav-daemon.service syslog.target network.target

[Service]
Type=simple
User=root
ExecStartPre=/bin/bash -c "while [ ! -S /run/clamav/clamd.ctl ]; do sleep 1; done"
ExecStart=/usr/sbin/clamonacc -F --config-file=@APP_CONFIG_DIRECTORY@/clamd.conf --log=/var/log/clamav/clamonacc.log --move=/root/quarantine

[Install]
WantedBy=multi-user.target

The 2nd ExecStart line has the --config-file=@APP_CONFIG_DIRECTORY@/clamd.conf part.

To me that looks like it should have been replaced by the real directory at build-time .
Checking upstream code at https://github.com/Cisco-Talos/clamav-d … service.in indicates clamav-clamonacc.service is not changed by archlinux pkgbuild.
To determine if this is an upstream error or a packaging bug requires further investigation.

Let's try to correct the mistake first.
Check https://wiki.archlinux.org/index.php/Sy … p-in_files and change the Execstart line  so --config-file is set to   /etc/clamav/clamd.conf


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2020-11-24 14:13:28

Hamsterkill
Member
Registered: 2009-05-05
Posts: 67

Re: clamav-clamonacc won't start

Overriding the ExecStart line does allow the service to start properly. It won't scan anything, but that's due to the --fdpass bug I mentioned in an earlier edit along with the fact that argument is not being passed by the service. It seems like the @APP_CONFIG_DIRECTORY@ issue is likely a build bug on Arch's side though. I'll file a bug so they can investigate.

Offline

#8 2020-11-27 01:16:52

snap.ve
Member
Registered: 2020-04-02
Posts: 76

Re: clamav-clamonacc won't start

Hamsterkill wrote:

Overriding the ExecStart line does allow the service to start properly. It won't scan anything, but that's due to the --fdpass bug I mentioned in an earlier edit along with the fact that argument is not being passed by the service. It seems like the @APP_CONFIG_DIRECTORY@ issue is likely a build bug on Arch's side though. I'll file a bug so they can investigate.

Same issue, hope they fix that soon

Offline

#9 2020-12-26 14:42:14

snap.ve
Member
Registered: 2020-04-02
Posts: 76

Re: clamav-clamonacc won't start

Still nothing?

Offline

#10 2020-12-28 11:32:56

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: clamav-clamonacc won't start


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#11 2020-12-30 12:44:18

snap.ve
Member
Registered: 2020-04-02
Posts: 76

Re: clamav-clamonacc won't start

Yeah. I was see that report at 1 month ago. Did they really can't fix such a trifle in a month?

Offline

Board footer

Powered by FluxBB