Unable to activate or remove Fail2ban: error reading information on service fail2ban: No such file or directory

Created:

2016-11-16 12:50:14 UTC

Modified:

2017-05-15 18:24:49 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to activate or remove Fail2ban: error reading information on service fail2ban: No such file or directory

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

  1. Unable to update Fail2ban settings or activate it:
    ERROR:f2bmng:No section: 'Definition'

or

    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
  1. Unable to remove Fail2ban:
    Error in PREUN scriptlet in rpm package fail2ban-0.8.13-centos7.14071718.noarch
    Exception: Scriptlet or other non-fatal errors occurred during transaction.
    Erasing: plesk-fail2ban-configurator [1/4]
    Redirecting to /bin/systemctl stop fail2ban.service
    Warning: Unit file of fail2ban.service changed on disk, 'systemctl daemon-reload' recommended.
    error reading information on service fail2ban: No such file or directory
    error: %preun(fail2ban-0.8.13-centos7.14071718.noarch) scriptlet failed, exit status 1
    error: fail2ban-0.8.13-centos7.14071718.noarch: erase failed

Cause

Corrupted Fail2ban installation.

Resolution

  1. Create init file:

    # wget https://support.plesk.com/hc/article_attachments/115004516205/fail2ban.gz
    # gunzip fail2ban.gz
    # mv fail2ban /etc/init.d/fail2ban
    # chmod 755 /etc/init.d/fail2ban
  2. Remove fail2ban package:

    # rpm -qa | grep fail2ban
    plesk-fail2ban-configurator-12.0.18-cos7.build1200140807.16.noarch
    fail2ban-0.8.13-centos7.14071718.noarch

    # rpm -e plesk-fail2ban-configurator-12.0.18-cos7.build1200140807.16.noarch
    # rpm -e fail2ban-0.8.13-centos7.14071718.noarch
    Stopping fail2ban (via systemctl): [ OK ]
  3. Remove /etc/init.d/fail2ban script:

    # rm /etc/init.d/fail2ban
  4. Install Fail2ban using Plesk installer:

    # plesk installer

Attachments:

Have more questions? Submit a request
Please sign in to leave a comment.