Page 1 of 1

fail2ban like stoped but running after yum update

Posted: Tue Feb 11, 2020 12:04 pm
by tlozano
After yum update, the fail2ban was updated and it appears like stoped in the web admin (server section).
The probem is that /usr/local/vesta/bin/v-list-sys-services can't detect fail2ban procces fine, because the old proccess was named "fail2ban-service", and after the update the new name of procces is "f2b/server".

Is it possible to patch the /usr/local/vesta/bin/v-list-sys-services to detect the new name?.

This is the output in the updated server (not working):
Image

And this before update (working):
Image

Thank you

****


Updated;

It works fine if I change in line 273 in the /usr/local/vesta/bin/v-list-sys-services
from:

Code: Select all

# Checking FIREWALL Fail2ban extention
if [ ! -z "$FIREWALL_EXTENSION" ]; then
    get_srv_state $FIREWALL_EXTENSION fail2ban-server script
    data="$data\nNAME='$FIREWALL_EXTENSION' SYSTEM='brute-force monitor'"
    data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
to:

Code: Select all

# Checking FIREWALL Fail2ban extention
if [ ! -z "$FIREWALL_EXTENSION" ]; then
    get_srv_state $FIREWALL_EXTENSION f2b/server script
    data="$data\nNAME='$FIREWALL_EXTENSION' SYSTEM='brute-force monitor'"
    data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
But ... It is correct?

Re: fail2ban like stoped but running after yum update

Posted: Tue Feb 25, 2020 3:35 pm
by Teo
After this fix the service is shown as active, but you can't restart it anyway.

Re: fail2ban like stoped but running after yum update

Posted: Tue Feb 25, 2020 5:01 pm
by tlozano
Teo wrote:
Tue Feb 25, 2020 3:35 pm
After this fix the service is shown as active, but you can't restart it anyway.
In my case, I can stop, start and restart the service fine. I only have nginx.

What command are you using to restart? Are you using the VestaCP Panel?

Re: fail2ban like stoped but running after yum update

Posted: Fri Feb 28, 2020 4:28 pm
by Teo
tlozano wrote:
Tue Feb 25, 2020 5:01 pm
Teo wrote:
Tue Feb 25, 2020 3:35 pm
After this fix the service is shown as active, but you can't restart it anyway.
In my case, I can stop, start and restart the service fine. I only have nginx.

What command are you using to restart? Are you using the VestaCP Panel?
yes the vestacp button donno why

Re: fail2ban like stoped but running after yum update

Posted: Tue Mar 10, 2020 7:26 pm
by tlozano
what is the output of /usr/local/vesta/bin/v-list-sys-services command?
This is the command that must work.

Re: fail2ban like stoped but running after yum update

Posted: Wed Mar 11, 2020 10:17 am
by kudouyuzi
tlozano wrote:
Tue Feb 11, 2020 12:04 pm
Updated;
But ... It is correct?
It already work, but it seems that memory consumption is very severe.

Image

Re: fail2ban like stoped but running after yum update

Posted: Wed Mar 11, 2020 12:18 pm
by tlozano
It is posible that any of the "jails" has some problem... You can disable all the "jails" and re-enable one to one to see the origin of problem.

I'm sorry, I don't known more ideas.

Re: fail2ban like stoped but running after yum update

Posted: Mon May 18, 2020 11:41 pm
by Kakarot
In my case after changing "fail2ban-server" for "f2b/server" it works for me, but my fail2ban also consumes a lot of RAM in centOS 7, is this normal? Can it be reduced?

Image

If I disable all the "jails" fail2ban it consumes about 3735 mb

Re: fail2ban like stoped but running after yum update

Posted: Mon Mar 01, 2021 7:59 pm
by Stage4000
Hey I know its been a while since you posted this but this solved my problem today and seems to be a very clean fix for anyone having issues with fail2ban not showing up as running on the admin panel. Thanks.