ClamAV remains paused in the services panel even though it’s running

Hello everyone, I need some help. I actually opened a topic here before but never got a good solution.

My ClamAV daemon is running fine, but the services panel reports it as stopped. I’ve tried a lot of things but nothing works haha. I’m running Debian.

In this file, as far as I understand, the services are listed:

vim /usr/local/hestia/bin/v-list-sys-services

And here is the section that detects the antivirus service:

# Checking MAIL ANTIVIRUS
if [ -n "$ANTIVIRUS_SYSTEM" ] && [ "$ANTIVIRUS_SYSTEM" != 'remote' ]; then
    if [ -d "/etc/sysconfig" ]; then
        if [ "$ANTIVIRUS_SYSTEM" == 'clamav' ]; then
            ANTIVIRUS_SYSTEM='clamd'
        fi
        get_srv_state "$ANTIVIRUS_SYSTEM"
    else
        if [ "$ANTIVIRUS_SYSTEM" == 'clamav-daemon' ]; then
            proc_name='clamd'
        fi
        get_srv_state "$ANTIVIRUS_SYSTEM" "$proc_name"
    fi
    data="$data\nNAME='$ANTIVIRUS_SYSTEM' SYSTEM='email anti-virus'"
    data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'"
    proc_name=''
fi

In another file, I have the service declaration:

vim /usr/local/hestia/conf/hestia.conf

There it’s set as:

ANTIVIRUS_SYSTEM='clamav-daemon'

Even if I change the first script to use ANTIVIRUS_SYSTEM='clamav-daemon', it still doesn’t work.

I just want it to show as running in the panel. Does anyone have any idea? I installed all components with the default setup.

Hi @molero.renan

Show the output of these commands:

ls -la /etc/sysconfig
systemctl status clamd --no-pager -l
pidof clamd | tr ' ' '|'

ls -la /etc/sysconfig

total 56
drwxr-xr-x   2 root root  4096 Nov 15  2024 .
drwxr-xr-x 132 root root 12288 Jun 26 12:30 ..
-rw-r--r--   1 root root     0 May 26  2024 ip6tables-custom
-rw-r--r--   1 root root  4713 Jun 26 21:19 iptables
-rw-r--r--   1 root root  8167 Jun 26 22:56 iptables4-jelastic
-rw-r--r--   1 root root  6537 Nov 15  2024 iptables4-jelastic.bak-2024-11-15T03-20-8.10-2
-rw-r--r--   1 root root   615 Jun 26 22:56 iptables6-jelastic
-rw-r--r--   1 root root  4329 Nov 15  2024 iptables.bak-2024-11-15T03-20-8.10-2
-rw-r--r--   1 root root    29 Sep  3  2024 network

systemctl status clamd --no-pager -l

Unit clamd.service could not be found.

pidof clamd | tr ’ ’ ‘|’

1479608

Hestia thinks you’re using a RedHat-based OS because the /etc/sysconfig directory exists.

The correct solution is to rename the /etc/sysconfig directory, as it doesn’t exist by default on Debian or Ubuntu systems. Alternatively, you could modify the Hestia script but keep in mind that your changes will be overwritten during the next update.

sed -i -E 's|/etc/sysconfig|/etc/ZsysconfigZ|' /usr/local/hestia/bin/v-list-sys-services
v-list-sys-services | grep clamav
1 Like

Thank you very much, Sahsanu. Your solution worked perfectly.

I guess I was just unlucky lol; that folder was created as part of a service on my VPS lol.
I’ll put the code you sent me into a service I have here that runs every night—so if I update Hestia overnight, it’ll fix itself lol.

Thanks again! I’ll link your answer as the solution in a thread I created earlier. Thanks again for your help.

1 Like