Applicable to:
- Plesk for Linux
Symptoms
-
Modifying fail2ban settings in Tools & Settings > IP Address Banning (Fail2Ban) fails with an error:
PLESK_ERROR: ERROR:f2bmng:No section: 'Definition'
PLESK_ERROR: Error: f2bmng failed: error reading information on service fail2ban: No such file or directory
ERROR:f2bmng:Command '['/sbin/chkconfig', '--add', 'fail2ban']' returned non-zero exit status 1
PLESK_ERROR: Error: Unable to save the settings: f2bmng failed: Service fail2ban doesn't exist
Usage: register_service {--enable service [options] | --disable service | --list | --full-list}
Enables or disables the specified service.
--enable enable the specified service
--disable disable the specified service
--list show list of services
--full-list show list of services with status
enable options:
--with-resource-controller register the service in Plesk Resource Controller
--no-watchdog don't monitor by watchdog
ERROR:main:Command '['/usr/local/psa/admin/sbin/register_service', '--enable', 'fail2ban']' returned non-zero exit status 1. -
On Red Hat -based operating system (RHEL, CentOS, CloudLinux) fail2ban cannot be completely removed from Tools & Settings > Updates and Upgrades:
PLESK_INFO: Error in PREUN scriptlet in rpm package 1:fail2ban-0.9.6-centos7.17122713.noarch
Exception: Scriptlet or other non-fatal errors occurred during transaction.
Erasing: plesk-fail2ban-configurator [1/2]
Failed to stop fail2ban.service: Unit fail2ban.service not loaded.
Failed to execute operation: No such file or directory
error: %preun(fail2ban-1:0.9.6-centos7.17122713.noarch) scriptlet failed, exit status 1
PLESK_INFO: Error in PREUN scriptlet in rpm package fail2ban
fail2ban-0.8.13-14052018.noarch was supposed to be removed but is not!
Exception: Scriptlet or other non-fatal errors occurred during transaction.
Erasing: plesk-fail2ban-configurator [1/2]
fail2ban: unrecognized service
error reading information on service fail2ban: No such file or directory
error: %preun(fail2ban-0.8.13-14052018.noarch) scriptlet failed, exit status 1
Cause
Corrupted Fail2ban installation.
Resolution
-
Connect to the server via SSH;
-
Create a backup of Fail2ban configuration and log:
# mkdir /fail2ban_backup && mv /etc/fail2ban /fail2ban_backup && mv /var/log/fail2ban.log /fail2ban_backup
-
Remove fail2ban-related packages:
-
For Red Hat -based operating systems (RHEL, CentOS, CloudLinux):
# rpm -e --nopreun fail2ban
# rpm -e --nopreun plesk-fail2ban-configurator -
For Debian-based operating systems (Debian, Ubuntu):
# plesk installer --select-release-current --remove-component fail2ban
-
-
Install fail2ban back using Plesk installer:
# plesk installer --select-release-current --install-component fail2ban
Comments
0 comments
Please sign in to leave a comment.