清风笑 发表于 2023-8-13 01:39:43

debian11.7 lnmp2.0 新装fail2ban发现状态不对

fail2ban-client status
Traceback (most recent call last):
File "/usr/bin/fail2ban-client", line 34, in <module>
    from fail2ban.client.fail2banclient import exec_command_line, sys
ImportError: No module named fail2ban.client.fail2banclient


清风笑 发表于 2023-8-13 01:52:12

先删除了
/etc/init.d/fail2ban stop
rm -rf /usr/local/bin/fail2ban*
rm -f /etc/init.d/fail2ban
rm -rf /etc/fail2ban/
rm -rf /var/run/fail2ban

原先在centos steam8上是正常的 直接安装就能用的 不知道在debian11.7下是什么情况了

licess 发表于 2023-8-13 09:43:19

安装过程的日志信息发一下

清风笑 发表于 2023-8-16 05:42:35

systemctl status fail2ban
● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/etc/systemd/system/fail2ban.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
       Docs: man:fail2ban(1)
root@debian:~/lnmp2.0/tools# systemctl start fail2ban
root@debian:~/lnmp2.0/tools# systemctl status fail2ban
● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/etc/systemd/system/fail2ban.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2023-08-16 05:40:44 CST; 1s ago
       Docs: man:fail2ban(1)
    Process: 595220 ExecStartPre=/bin/mkdir -p /run/fail2ban (code=exited, status=0/SUCCESS)
    Process: 595221 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=1/FAILURE)
   Main PID: 595221 (code=exited, status=1/FAILURE)
      CPU: 14ms

Aug 16 05:40:44 debian systemd: fail2ban.service: Scheduled restart job, restart counter is at 5.
Aug 16 05:40:44 debian systemd: Stopped Fail2Ban Service.
Aug 16 05:40:44 debian systemd: fail2ban.service: Start request repeated too quickly.
Aug 16 05:40:44 debian systemd: fail2ban.service: Failed with result 'exit-code'.
Aug 16 05:40:44 debian systemd: Failed to start Fail2Ban Service.
root@debian:~/lnmp2.0/tools# fail2ban-client -d
Traceback (most recent call last):
File "/usr/bin/fail2ban-client", line 34, in <module>
    from fail2ban.client.fail2banclient import exec_command_line, sys
ImportError: No module named fail2ban.client.fail2banclient

清风笑 发表于 2023-8-16 05:48:37

这是日志
Aug 16 05:40:43 debian fail2ban-server:   from fail2ban.client.fail2banserver import exec_command_line, sys
Aug 16 05:40:43 debian fail2ban-server: ImportError: No module named fail2ban.client.fail2banserver
Aug 16 05:40:43 debian systemd: fail2ban.service: Main process exited, code=exited, status=1/FAILURE
░░ An ExecStart= process belonging to unit fail2ban.service has exited.
Aug 16 05:40:43 debian systemd: fail2ban.service: Failed with result 'exit-code'.
░░ The unit fail2ban.service has entered the 'failed' state with result 'exit-code'.
Aug 16 05:40:43 debian systemd: fail2ban.service: Scheduled restart job, restart counter is at 2.
░░ Automatic restarting of the unit fail2ban.service has been scheduled, as the result for
░░ Subject: A stop job for unit fail2ban.service has finished
░░ A stop job for unit fail2ban.service has finished.
░░ Subject: A start job for unit fail2ban.service has begun execution
░░ A start job for unit fail2ban.service has begun execution.
░░ Subject: A start job for unit fail2ban.service has finished successfully
░░ A start job for unit fail2ban.service has finished successfully.
Aug 16 05:40:43 debian fail2ban-server: Traceback (most recent call last):
Aug 16 05:40:43 debian fail2ban-server:   File "/usr/bin/fail2ban-server", line 34, in <module>
Aug 16 05:40:43 debian fail2ban-server:   from fail2ban.client.fail2banserver import exec_command_line, sys
Aug 16 05:40:43 debian fail2ban-server: ImportError: No module named fail2ban.client.fail2banserver
Aug 16 05:40:43 debian systemd: fail2ban.service: Main process exited, code=exited, status=1/FAILURE
░░ An ExecStart= process belonging to unit fail2ban.service has exited.
Aug 16 05:40:43 debian systemd: fail2ban.service: Failed with result 'exit-code'.
░░ The unit fail2ban.service has entered the 'failed' state with result 'exit-code'.
Aug 16 05:40:43 debian systemd: fail2ban.service: Scheduled restart job, restart counter is at 3.
░░ Automatic restarting of the unit fail2ban.service has been scheduled, as the result for
░░ Subject: A stop job for unit fail2ban.service has finished
░░ A stop job for unit fail2ban.service has finished.
░░ Subject: A start job for unit fail2ban.service has begun execution
░░ A start job for unit fail2ban.service has begun execution.
░░ Subject: A start job for unit fail2ban.service has finished successfully
░░ A start job for unit fail2ban.service has finished successfully.
Aug 16 05:40:43 debian fail2ban-server: Traceback (most recent call last):
Aug 16 05:40:43 debian fail2ban-server:   File "/usr/bin/fail2ban-server", line 34, in <module>
Aug 16 05:40:43 debian fail2ban-server:   from fail2ban.client.fail2banserver import exec_command_line, sys
Aug 16 05:40:43 debian fail2ban-server: ImportError: No module named fail2ban.client.fail2banserver
Aug 16 05:40:43 debian systemd: fail2ban.service: Main process exited, code=exited, status=1/FAILURE
░░ An ExecStart= process belonging to unit fail2ban.service has exited.
Aug 16 05:40:43 debian systemd: fail2ban.service: Failed with result 'exit-code'.
░░ The unit fail2ban.service has entered the 'failed' state with result 'exit-code'.
Aug 16 05:40:44 debian systemd: fail2ban.service: Scheduled restart job, restart counter is at 4.
░░ Automatic restarting of the unit fail2ban.service has been scheduled, as the result for
░░ Subject: A stop job for unit fail2ban.service has finished
░░ A stop job for unit fail2ban.service has finished.
░░ Subject: A start job for unit fail2ban.service has begun execution
░░ A start job for unit fail2ban.service has begun execution.
░░ Subject: A start job for unit fail2ban.service has finished successfully
░░ A start job for unit fail2ban.service has finished successfully.
Aug 16 05:40:44 debian fail2ban-server: Traceback (most recent call last):
Aug 16 05:40:44 debian fail2ban-server:   File "/usr/bin/fail2ban-server", line 34, in <module>
Aug 16 05:40:44 debian fail2ban-server:   from fail2ban.client.fail2banserver import exec_command_line, sys
Aug 16 05:40:44 debian fail2ban-server: ImportError: No module named fail2ban.client.fail2banserver
Aug 16 05:40:44 debian systemd: fail2ban.service: Main process exited, code=exited, status=1/FAILURE
░░ An ExecStart= process belonging to unit fail2ban.service has exited.
Aug 16 05:40:44 debian systemd: fail2ban.service: Failed with result 'exit-code'.
░░ The unit fail2ban.service has entered the 'failed' state with result 'exit-code'.
Aug 16 05:40:44 debian systemd: fail2ban.service: Scheduled restart job, restart counter is at 5.
░░ Automatic restarting of the unit fail2ban.service has been scheduled, as the result for
░░ Subject: A stop job for unit fail2ban.service has finished
░░ A stop job for unit fail2ban.service has finished.
Aug 16 05:40:44 debian systemd: fail2ban.service: Start request repeated too quickly.
Aug 16 05:40:44 debian systemd: fail2ban.service: Failed with result 'exit-code'.
░░ The unit fail2ban.service has entered the 'failed' state with result 'exit-code'.
░░ Subject: A start job for unit fail2ban.service has failed
░░ A start job for unit fail2ban.service has finished with a failure.
页: [1]
查看完整版本: debian11.7 lnmp2.0 新装fail2ban发现状态不对