Job for fail2ban.service failed because the control process exited with error code

10,683

Solution 1

Per Homunculus Reticulli, Oct 29 '16 at 18:26, the following suggestion resolved my issue:

cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

Solution 2

If I am not wrong you have not installed any MTA (sendmail/postfix) on the server. Try to restart the fail2ban after installing the sendmail/postfix.

I have fixed the issue after installing the MTA.

Share:
10,683

Related videos on Youtube

Homunculus Reticulli
Author by

Homunculus Reticulli

Updated on September 18, 2022

Comments

  • Homunculus Reticulli
    Homunculus Reticulli almost 2 years

    I have installed fail2ban on my server (OS: Ubuntu 16.0.4 LTS). When I try to start it, I get the following error message:

    Job for fail2ban.service failed because the control process exited with error code.
    

    Here are the outputs for various diagnostic commands:

    morpheous@ZEUS:~$ sudo 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 Sat 2016-10-29 11:46:36 UTC; 18s ago
         Docs: man:fail2ban(1)
      Process: 23122 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
    
    Oct 29 11:46:36 ZEUS systemd[1]: fail2ban.service: Unit entered failed state.
    Oct 29 11:46:36 ZEUS systemd[1]: fail2ban.service: Failed with result 'exit-code'.
    Oct 29 11:46:36 ZEUS systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
    Oct 29 11:46:36 ZEUS systemd[1]: Stopped Fail2Ban Service.
    Oct 29 11:46:36 ZEUS systemd[1]: fail2ban.service: Start request repeated too quickly.
    Oct 29 11:46:36 ZEUS systemd[1]: Failed to start Fail2Ban Service.
    
    
    
    morpheous@ZEUS:~$ sudo journalctl -xe
    Oct 29 11:46:36 ZEUS systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
    Oct 29 11:46:36 ZEUS systemd[1]: Stopped Fail2Ban Service.
    -- Subject: Unit fail2ban.service has finished shutting down
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit fail2ban.service has finished shutting down.
    Oct 29 11:46:36 ZEUS systemd[1]: fail2ban.service: Start request repeated too quickly.
    Oct 29 11:46:36 ZEUS systemd[1]: Failed to start Fail2Ban Service.
    -- Subject: Unit fail2ban.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit fail2ban.service has failed.
    -- 
    -- The result is failed.
    Oct 29 11:46:55 ZEUS sudo[23124]: morpheous : TTY=pts/0 ; PWD=/home/morpheous ; USER=root ; COMMAND=/bin/systemctl status fail2ban.service
    Oct 29 11:46:55 ZEUS sudo[23124]: pam_unix(sudo:session): session opened for user root by morpheous(uid=0)
    Oct 29 11:46:55 ZEUS sudo[23124]: pam_unix(sudo:session): session closed for user root
    Oct 29 11:47:01 ZEUS kernel: iptables_INPUT_denied: IN=eth0 OUT= MAC=[mac_address] SRC=[lan_ip_address] DST=[server_ip_address]
    Oct 29 11:47:09 ZEUS sudo[23128]: morpheous : TTY=pts/0 ; PWD=/home/morpheous ; USER=root ; COMMAND=/bin/journalctl -xe
    Oct 29 11:47:09 ZEUS sudo[23128]: pam_unix(sudo:session): session opened for user root by morpheous(uid=0)
    lines 1353-1374/1374 (END)
    

    Does anyone know what's going on here, and more importantly - how to resolve this issue?

    • You'reAGitForNotUsingGit
      You'reAGitForNotUsingGit over 7 years
    • Homunculus Reticulli
      Homunculus Reticulli over 7 years
      @AndroidDev, I just copied over /etc/fail2ban/jail.conf to /etc/fail2ban/jail.local, and it is working now - with all the defaults left unmodified. Perhaps you should submit this as an answer.
    • You'reAGitForNotUsingGit
      You'reAGitForNotUsingGit over 7 years
      Okay, let me get this right, the fix was to run cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local?
    • Homunculus Reticulli
      Homunculus Reticulli over 7 years
      @AndroidDev Yes, I decided to go with the default instead of making modifications to the file. It appears, some of the edits I made previously, caused the script to fail.
    • Eric Darchis
      Eric Darchis over 5 years
      My error was that I added a file in /etc/jail.d/foo.conf with an ignoreip=... I removed that file, made a jail.local instead and all was good. It's a pity that there isn't a single clue in the logs about this.