AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 413691
Accepted
ensabahn
ensabahn
Asked: 2017-12-30 09:12:25 +0800 CST2017-12-30 09:12:25 +0800 CST 2017-12-30 09:12:25 +0800 CST

dpkg:错误处理包fail2ban(--configure):

  • 772

我正在尝试在我的 ubuntu 服务器 16.04 上安装 fail2ban 服务,但是我有这个错误并且 fail2ban 服务无法启动,这是什么问题?

root@clm:~# apt install fail2ban
Reading package lists... Done
Building dependency tree       
Reading state information... Done
fail2ban is already the newest version (0.9.3-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up 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.
● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2017-12-29 18:08:01 CET; 8ms ago
     Docs: man:fail2ban(1)
  Process: 4888 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)

Dec 29 18:08:01 domain systemd[1]: Failed to start Fail2Ban Service.
Dec 29 18:08:01 domain systemd[1]: fail2ban.service: Unit entered failed state.
Dec 29 18:08:01 domain systemd[1]: fail2ban.service: Failed with result 'exit-code'.
dpkg: error processing package fail2ban (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)

日志说是这样的,

root@clm:~# 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 Fri 2017-12-29 18:27:09 CET; 9min ago
     Docs: man:fail2ban(1)
  Process: 7277 ExecStop=/usr/bin/fail2ban-client stop (code=exited, status=0/SUCCESS)
  Process: 7301 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
 Main PID: 7026 (code=killed, signal=TERM)

Dec 29 18:27:09 domain systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Dec 29 18:27:09 domain systemd[1]: Failed to start Fail2Ban Service.
Dec 29 18:27:09 domain systemd[1]: fail2ban.service: Unit entered failed state.
Dec 29 18:27:09 domain systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Dec 29 18:27:09 domain systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Dec 29 18:27:09 domain systemd[1]: Stopped Fail2Ban Service.
Dec 29 18:27:09 domain systemd[1]: fail2ban.service: Start request repeated too quickly.
Dec 29 18:27:09 domain systemd[1]: Failed to start Fail2Ban Service.
root@clm:~# tail -f /var/log/fail2ban.log 
2017-12-29 18:26:08,198 fail2ban.actions        [7026]: INFO    Set banTime = 600
2017-12-29 18:26:08,262 fail2ban.filter         [7026]: INFO    Added logfile = /var/log/auth.log
2017-12-29 18:26:08,330 fail2ban.filter         [7026]: INFO    Set jail log file encoding to UTF-8
2017-12-29 18:26:08,331 fail2ban.filter         [7026]: INFO    Set maxRetry = 5
2017-12-29 18:26:08,331 fail2ban.filter         [7026]: INFO    Set maxlines = 10
2017-12-29 18:26:08,448 fail2ban.server         [7026]: INFO    Jail sshd is not a JournalFilter instance
2017-12-29 18:26:08,465 fail2ban.jail           [7026]: INFO    Jail 'sshd' started
2017-12-29 18:27:05,924 fail2ban.server         [7026]: INFO    Stopping all jails
2017-12-29 18:27:06,756 fail2ban.jail           [7026]: INFO    Jail 'sshd' stopped
2017-12-29 18:27:06,831 fail2ban.server         [7026]: INFO    Exiting Fail2ban
ubuntu fail2ban
  • 2 2 个回答
  • 2323 Views

2 个回答

  • Voted
  1. Diego Roccia
    2017-12-30T09:53:14+08:002017-12-30T09:53:14+08:00

    我的猜测是配置文件有问题。尝试运行

    fail2ban-server  -f -x
    

    看看会发生什么

    • 2
  2. Best Answer
    ensabahn
    2017-12-30T09:54:10+08:002017-12-30T09:54:10+08:00

    好吧,这就是问题所在,

    在我检查后journalctl -xe,我发现了一个(可能是错误的配置/这是一个错误),这是日志:

    Dec 29 18:46:27 *domain* fail2ban-client[7530]: ERROR  Failed during configuration: While reading from '/etc/fail2ban/jail.local' [line 99]: option 'port' in section 'pam-generic'
    

    所以我尝试line 99像日志说的那样发表评论,它现在正在工作,而之前,我尝试在 ubuntu 14.04 上实现运行良好

    • 2

相关问题

  • 使 Apple 键盘设置在 ../hid_apple/parameters/ 中持久化

  • 用文件中的点绘制二维图形

  • 如何验证我使用 9.9.9.9 作为 DNS?

  • 并行安装多个 linux 发行版

  • 自编译 OpenVPN 不会从 systemd 启动

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    JSON数组使用jq来bash变量

    • 4 个回答
  • Marko Smith

    日期可以为 GMT 时区格式化当前时间吗?[复制]

    • 2 个回答
  • Marko Smith

    bash + 通过 bash 脚本从文件中读取变量和值

    • 4 个回答
  • Marko Smith

    如何复制目录并在同一命令中重命名它?

    • 4 个回答
  • Marko Smith

    ssh 连接。X11 连接因身份验证错误而被拒绝

    • 3 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Marko Smith

    systemctl 命令在 RHEL 6 中不起作用

    • 3 个回答
  • Marko Smith

    rsync 端口 22 和 873 使用

    • 2 个回答
  • Marko Smith

    以 100% 的利用率捕捉 /dev/loop -- 没有可用空间

    • 1 个回答
  • Marko Smith

    jq 打印子对象中所有的键和值

    • 2 个回答
  • Martin Hope
    EHerman JSON数组使用jq来bash变量 2017-12-31 14:50:58 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Drux 日期可以为 GMT 时区格式化当前时间吗?[复制] 2017-12-26 11:35:07 +0800 CST
  • Martin Hope
    AllisonC 如何复制目录并在同一命令中重命名它? 2017-12-22 05:28:06 +0800 CST
  • Martin Hope
    Steve “root”用户的文件权限如何工作? 2017-12-22 02:46:01 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST
  • Martin Hope
    Cbhihe 将默认编辑器更改为 vim for _ sudo systemctl edit [unit-file] _ 2017-12-03 10:11:38 +0800 CST
  • Martin Hope
    showkey 如何下载软件包而不是使用 apt-get 命令安装它? 2017-12-03 02:15:02 +0800 CST
  • Martin Hope
    youxiao 为什么目录 /home、/usr、/var 等都具有相同的 inode 编号 (2)? 2017-12-02 05:33:41 +0800 CST
  • Martin Hope
    user223600 gpg —list-keys 命令在将私钥导入全新安装后输出 uid [未知] 2017-11-26 18:26:02 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve