列出所有启动失败的 systemd 服务

显示当前处于 failed 状态的所有 systemd 单元,方便逐一排查并重新启动出问题的服务。

Linux进程系统诊断中风险
执行 systemctl --failed 即可列出当前所有 failed 状态的单元。

01命令

命令
$ systemctl --failed

02作用说明

systemctl --failed 等价于 systemctl list-units --state=failed,会显示单元名称、加载状态和简短的 Failed 说明。对列出的每个单元运行 systemctl status <unit>,可看到退出码和最后的日志片段(输出中还会提示对应的 journalctl 命令)。修复原因后,用 systemctl reset-failed <unit> 清除失败状态,不带参数则清除全部。加 --user 可检查用户级单元而非系统级单元。

03风险

风险中风险

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • systemctl(1) — Linux manual page
    man7.org · technical · 2026-09-17
    依据: The systemctl man page documents '--failed' as listing units that are in a failed state, making them easier to identify.
  • systemd - ArchWiki
    Arch Linux Wiki · community · 2026-09-17
    依据: The ArchWiki systemd page recommends systemctl --failed to quickly list units that failed to run at boot.

最后验证: 2026-09-17 · 分类: 系统与设置

06相关方案