用 systemctl reset-failed 清除失败单元状态
systemctl reset-failed 可让卡在 failed 状态的单元不再出现在状态输出和监控中。
运行 `sudo systemctl reset-failed` 清除所有处于 failed 状态的单元记录,也可只指定某个单元。
01命令
命令
$ sudo systemctl reset-failed02作用说明
单元一旦失败,systemd 会一直记录失败状态,直到重启或重置,因此在修复问题后 `systemctl` 输出仍会列出它。`reset-failed` 就是清除这条记录;不带参数时会一次性重置所有失败单元。在重载监控配置前,或要消除一次性单元非零退出导致的告警时,这个命令很常用。
03风险
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- systemctl(1) - Control the systemd system and service manager依据: reset-failed [PATTERN...]: Reset the failed state of the specified units; when no argument is given, reset all units with a failed state.
最后验证: 2026-09-17 · 分类: 系统与设置
06相关方案
用 systemctl cat/edit 查看和覆盖服务单元
systemctl cat 会显示服务单元文件及所有 drop-in 覆盖;systemctl edit 可以不碰官方文件地创建覆盖配置。
用 systemctl --user 管理自己的服务(免 root)
systemd 为每个用户运行独立的服务管理器,放在 ~/.config/systemd/user/ 的单元可以在登录时自动启动,完全不需要 sudo。
用 `ip -br a` 以紧凑表格显示 IP 地址
一条命令就能把每个网卡的名称、状态和 IPv4/IPv6 地址打印成简短表格——这是取代又长又难记的 `ifconfig` 和冗长的 `ip addr` 输出的现代做法。