• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

fail2ban does not start: Unable to remove PID file

Tommy10

Basic Pleskian
I am not able to start fail2ban anymore. It always crashes while it starts.

Error:
Code:
Unable to remove PID file: [Errno 2] No such file or directory: '/var/run/fail2ban/fail2ban.pid'

The directory /var/run/fail2ban/ exists. The PID file does not exist. If I create it it will be deleted but the error still occurs. This is crazy.

I also tried to reinstall fail2ban over the Plesk Installer - the issue still occurs.

My system: Debian 8.4, Plesk 12.5.30 Update #32


$ ls -al /var/run/fail2ban/
Code:
total 0
drwxr-x---  2 root root  40 May 23 02:59 .
drwxr-xr-x 26 root root 1080 May 23 02:25 ..

/var/log/fail2ban.log
Code:
2016-05-23 02:41:59,874 fail2ban.server  [24474]: DEBUG  Caught signal 15. Exiting
2016-05-23 02:41:59,874 fail2ban.asyncserver  [24474]: DEBUG  Removed socket file /var/run/fail2ban/fail2ban.sock
2016-05-23 02:41:59,874 fail2ban.asyncserver  [24474]: DEBUG  Socket shutdown
2016-05-23 02:41:59,874 fail2ban.server  [24474]: INFO  Stopping all jails
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-apache-badbot
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-roundcube
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-panel
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-apache
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-dovecot
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail ssh
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-postfix
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-horde
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-proftpd
2016-05-23 02:41:59,875 fail2ban.server  [24474]: DEBUG  Stopping jail plesk-wordpress
2016-05-23 02:41:59,876 fail2ban.datedetector  [24474]: DEBUG  Sorting the template list
2016-05-23 02:41:59,876 fail2ban.datedetector  [24474]: DEBUG  Winning template: (?:DAY )?MON Day 24hour:Minute:Second(?:\.Microseconds)?(?: Year)? with 0 hits
2016-05-23 02:41:59,876 fail2ban.server  [24474]: DEBUG  Remove PID file /var/run/fail2ban/fail2ban.pid
2016-05-23 02:41:59,876 fail2ban.server  [24474]: ERROR  Unable to remove PID file: [Errno 2] No such file or directory: '/var/run/fail2ban/fail2ban.pid'
2016-05-23 02:41:59,876 fail2ban.server  [24474]: INFO  Exiting Fail2ban
 
I have fixed it the hard way:
$ apt-get purge fail2ban

You need to run "purge" to fully delete all configuration files of `fail2ban`. The Plesk Installer will only remove the `fail2ban` application and not it's configuration files.

Warning: Your fail2ban configurations will be lost.
 
I used this

https://kb.plesk.com/en/122407

with same errors as above, for me the solution was to disable all apache-badbot jails created wit the hipelink guide and got started fail2ban with no problem, later little by little, (in six times), enabled the apache-badbot jails again.

Now i can make modifications in fail2ban configuration and is working so fine apache-badbot, apache, courier-imap and postfix jails enabled
 
Back
Top