You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● systemd-vconsole-setup.service loaded failed failed Virtual Console Setup
Legend: 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.
1 loaded units listed.
解决这个问题后,重启相应服务,再查看系统状态:
$ systemctl is-system-running
running
$ echo$?
0
$ systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
man systemctl
is-system-running
检查系统是否正常运行,打印系统状态。只有在系统完全启动并且运行,且没有任何失败的服务时,命令才返回成功(退出状态 0)。
这表示系统运行,但是有一个或多个服务失败了。查看失败的服务:
解决这个问题后,重启相应服务,再查看系统状态:
default / rescue / emergency
执行不同的命令,系统会进入不同的模式/目标,它们的主要区别在于系统加载的服务和功能范围不同。
查看系统默认的目标:
# 树莓派/aarch64/无图形界面 $ systemctl get-default multi-user.target
# 笔记本/x86_64/有图形界面 $ systemctl get-default graphical.target
multi-user.target 表示系统当前的默认运行目标是命令行多用户模式。graphical.target 表示系统当前的默认运行目标是图形界面模式。
进入 rescue 模式:
进入 emergency 模式:
电源管理
halt
关闭并停止系统运行,硬件仍会保持通电状态。
在我的笔记本(Manjaro, x86_64)上测试,执行
sudo systemctl halt
命令后,笔记本呼吸灯亮,有线鼠标有电,手机依然可以充电。长按电源键后,笔记本呼吸灯灭,有线鼠标指示灯灭,手机不可以充电。再次按电源键开机。在树莓派上测试,有线鼠标指示灯灭,手机不可以充电。好像树莓派上 halt 和 poweroff 是一样的。
我查了一些资料,但还是没搞懂 halt 的实际用处是什么。
其他电源管理命令
See also
The text was updated successfully, but these errors were encountered: