首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >systemctl状态显示:“状态:降级”

systemctl状态显示:“状态:降级”
EN

Unix & Linux用户
提问于 2018-06-03 02:48:17
回答 5查看 184.6K关注 0票数 142

当我运行systemctl status的时候,我把State: degraded放在了顶端,

代码语言:javascript
运行
复制
● x230
    State: degraded
     Jobs: 0 queued
   Failed: 1 units
    Since: Wed 2018-05-30 17:09:49 CDT; 3 days ago
  ....

怎么回事,我该怎么解决?

EN

回答 5

Unix & Linux用户

回答已采纳

发布于 2018-06-03 02:48:17

这意味着您的一些服务无法启动。如果在不使用systemctl;参数的情况下运行status,则可以看到它们。

他们应该表现得像,

代码语言:javascript
运行
复制
loaded failed failed

或者您可以使用systemctl --failed列出失败的服务,在我的例子中,它显示了

代码语言:javascript
运行
复制
  UNIT                        LOAD   ACTIVE SUB    DESCRIPTION                
● postgresql@9.4-main.service loaded failed failed PostgreSQL Cluster 9.4-main

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

通常,您需要阅读日记/日志,以便通过使用journalctl -xe了解下一步该如何处理该失败项。如果您只想重置单元,以便系统“显示”使用绿色点的running,则可以运行:

代码语言:javascript
运行
复制
systemctl reset-failed
票数 178
EN

Unix & Linux用户

发布于 2019-04-18 18:17:12

你也可以尝试:

代码语言:javascript
运行
复制
sudo systemctl reset-failed

系统重置失败正在清除失败的单元。您可以使用systemctl重置失败命令手动清除失败的单元.这可以为所有单位,或一个单一的单位。不再需要的服务最好被停止和禁用。

代码语言:javascript
运行
复制
reset-failed [PATTERN...]
           Reset the "failed" state of the specified units, or if no unit name is passed, reset the state of all units. When a unit
           fails in some way (i.e. process exiting with non-zero error code, terminating abnormally or timing out), it will
           automatically enter the "failed" state and its exit code and status is recorded for introspection by the administrator
           until the service is stopped/re-started or reset with this command.

           In addition to resetting the "failed" state of a unit it also resets various other per-unit properties: the start rate
           limit counter of all unit types is reset to zero, as is the restart counter of service units. Thus, if a unit's start
           limit (as configured with StartLimitIntervalSec=/StartLimitBurst=) is hit and the unit refuses to be started again, use
           this command to make it startable again.
票数 35
EN

Unix & Linux用户

发布于 2020-02-12 04:35:40

列出失败的单元/服务

$ systemctl --失败

单元负载主动子描述

ipmievd.service加载失败Ipmievd守护进程失败

kdump.service加载失败崩溃恢复内核武装失败

LOAD =反映单元定义是否正确加载。

ACTIVE =高级单元激活状态,即子的泛化。

SUB =低级单元激活状态,值取决于单元类型.

2个装载单位列出。通过

要显示所有已安装的单元文件,请使用“systemctl列表-单元-文件”。

票数 20
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/447561

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档