1

I installed a new Ubuntu 16.04 LTS server. I want to protect it with fail2ban, but when I try to install the package I get an error.

How do I resolve this problem?

> apt-get install fail2ban
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
fail2ban is already the newest version (0.9.3-1).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
1 partiellement installés ou enlevés.
Après cette opération, 0 o d'espace disque supplémentaires seront utilisés.
Souhaitez-vous continuer ? [O/n] o
Paramétrage de fail2ban (0.9.3-1) ...
Job for fail2ban.service failed because the control process exited with error code. See "systemctl status fail2ban.service" and "journalctl -xe" for details.
invoke-rc.d: initscript fail2ban, action "start" failed.
dpkg: erreur de traitement du paquet fail2ban (--configure) :
 le sous-processus script post-installation installé a retourné une erreur de sortie d'état 1
Des erreurs ont été rencontrées pendant l'exécution :
 fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)

> systemctl status fail2ban.service
 fail2ban.service - Fail2Ban Service
   Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since mar. 2016-11-15 16:02:23 CET; 2min 43s ago
     Docs: man:fail2ban(1)
  Process: 11301 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)

nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Control process exited, code=exited status=255
nov. 15 16:02:23 MBjumpbox systemd[1]: Failed to start Fail2Ban Service.
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Unit entered failed state.
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Failed with result 'exit-code'.
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
nov. 15 16:02:23 MBjumpbox systemd[1]: Stopped Fail2Ban Service.
nov. 15 16:02:23 MBjumpbox systemd[1]: fail2ban.service: Start request repeated too quickly.
nov. 15 16:02:23 MBjumpbox systemd[1]: Failed to start Fail2Ban Service.

/var/log/fail2ban.log is empty:

ls -l /var/log/fail2ban.log
-rw-r----- 1 root adm 0 nov.  15 16:02 /var/log/fail2ban.log
2
1

OK finally I resolve it with :

  • apt-get remove fail2ban
  • apt-get autoremove
  • apt-get install fail2ban
1
  • 1
    I also had to delete /etc/fail2ban completely with rm -rf then it worked... Aug 31 '17 at 16:19
1

Resolved by the following.

apt-get remove fail2ban
apt-get autoremove
rm -rf /etc/fail2ban/
apt-get install fail2ban
0

The user editable file is jail.local. Jail.conf on the 16.04 version needs to be copied to a new jail.local file. You then manually "diff" the old .local and the new .local file and copy any changes in manually. This fixed the problem for me!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.