• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Issue Fail2Ban never starts

lepe

Basic Pleskian
Hi

I cant start Fail2Ban from Plesk or ssh. Before I received always error code 255 and i uninstalled and reinstalled like this plesk user but it dont start

I tried with this plesk post without luck

I attach ssh messages about fail2ban.pid not readable

thank you
 

Attachments

  • fail2ban.jpg
    fail2ban.jpg
    53.3 KB · Views: 18
Your screenshot shows fail2ban.pid in a location where (as far as I'm aware) by default it isn't.

Check if my suspicion is correct:

dir /var/run/fail2ban/

It will probably show you that that's where fail2ban.pid is located. Open the service file with nano or vim:

nano /usr/lib/systemd/system/fail2ban.service

And check the line that says:

PIDFile=/var/run/fail2ban/fail2ban.pid

Make sure it matches your actual fail2ban.pid file location. If that doesn't work make sure you locate the file and that it's correctly set at fail2ban.service and check the rights. If the rights are incorrect chmod it to fix it.
 
Hi steven_h

Thank you for your info. I checked it but file location seem to be in right place as I attach in images
 

Attachments

  • fail2ban.jpg
    fail2ban.jpg
    49.2 KB · Views: 9
np Lepe! To get a more clear idea of the possible cause, could you enlarge your console so we can see the entire message that's output by systemctl status fail2ban?

Usually there's some additional info behind the initial error that's visible in your screenshot. It's also advisable to check what error fail2ban shows in journalctl -xe. Personally I find it easier to work with that.
 
Hi

From Plesk I received this error: ERROR:f2bmng:Failed to start fail2ban service
From plesk log, the next message is repeated when I try enable it:
2018-04-19 15:29:45,800 fail2ban.server [7726]: INFO Stopping all jails
2018-04-19 15:29:45,800 fail2ban.server [7726]: INFO Exiting Fail2ban
2018-04-19 15:29:46,338 fail2ban.server [7761]: INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.9.6
2018-04-19 15:29:46,340 fail2ban.database [7761]: INFO Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3'

I attach message requested

Thank you
 

Attachments

  • fail2b.jpg
    fail2b.jpg
    48.1 KB · Views: 10
Check that /var/run directory have correct permissions. It should be like

Code:
# stat  /var/run
  File: ‘/var/run’ -> ‘../run’
  Size: 6               Blocks: 0          IO Block: 4096   symbolic link
Device: 1ah/26d Inode: 71979582    Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
 
Hi IgorG

Permission are good (0777/lrwxrwxrwx)

Do you think my CSF/LFD firewall could be blocking fail2ban?
Any other idea?
 
does the directory /var/run/fail2ban/ exist?

this is sounding like a really old bug. is fail2ban up to date?
 
How many log files need to be processed and how big are they? It is possible that a fail2ban start is timing out when fail2ban has to process too many log files in a row or single log files are very large (while "very large" is a yet to be defined size).
 
Back
Top