22 管理服务-关闭、暂停、休眠系统服务
22.1 systemctl命令
systemd通过systemctl命令可以对系统进行关机、重启、休眠等一系列操作。当前仍兼容部分Linux常用管理命令,对应关系如表8。建议用户使用systemctl命令进行操作。
表 8 命令对应关系
Linux常用管理命令 | systemctl命令 | 描述 |
---|---|---|
halt | systemctl halt | 关闭系统 |
poweroff | systemctl poweroff | 关闭电源 |
reboot | systemctl reboot | 重启 |
22.2 关闭系统
关闭系统并下电,在root权限下执行如下命令:
# systemctl poweroff
例如示例命令如下: