22 openEuler 管理服务-关闭、暂停、休眠服务

59 阅读2分钟

开启掘金成长之旅!这是我参与「掘金日新计划 · 2 月更文挑战」的第 22 天

22 openEuler 管理服务-关闭、暂停、休眠服务22 管理服务-关闭、暂停、休眠系统服务22.1 systemctl命令22.2 关闭系统22.3 重启系统22.4 使系统待机22.5 使系统休眠

22 管理服务-关闭、暂停、休眠系统服务

22.1 systemctl命令

systemd通过systemctl命令可以对系统进行关机、重启、休眠等一系列操作。当前仍兼容部分Linux常用管理命令,对应关系如表8。建议用户使用systemctl命令进行操作。

表 8 命令对应关系

Linux常用管理命令systemctl命令描述
haltsystemctl halt关闭系统
poweroffsystemctl poweroff关闭电源
rebootsystemctl reboot重启

22.2 关闭系统

关闭系统并下电,在root权限下执行如下命令:

# systemctl poweroff

例如示例命令如下:

[root@superman-21 ~]# systemctl poweroff
[root@superman-21 ~]# 

关闭系统但不下电机器,在root权限下执行如下命令:

# systemctl halt

例如示例命令如下:

[root@superman-21 ~]# systemctl halt
[root@superman-21 ~]#

22.3 重启系统

重启系统,在root权限下执行如下命令:

# systemctl reboot

例如示例命令如下:

[root@superman-21 ~]# systemctl reboot
[root@superman-21 ~]# 

22.4 使系统待机

使系统待机,在root权限下执行如下命令:

# systemctl suspend

例如示例命令如下:

[root@superman-21 ~]# systemctl suspend
[root@superman-21 ~]# 

22.5 使系统休眠

使系统休眠,在root权限下执行如下命令:

# systemctl hibernate

例如示例命令如下:

[root@superman-21 ~]# systemctl hibernate
[root@superman-21 ~]# 

使系统待机且处于休眠状态,在root权限下执行如下命令:

# systemctl hybrid-sleep

例如示例命令如下:

[root@superman-21 ~]# systemctl hybrid-sleep
[root@superman-21 ~]# 

👍 点赞,你的认可是我创作的动力!

⭐️ 收藏,你的青睐是我努力的方向!

✏️ 评论,你的意见是我进步的财富!

image-20230218223308524

开启掘金成长之旅!这是我参与「掘金日新计划 · 2 月更文挑战」的第 22 天