Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

如何禁用戴尔笔记本电脑的 Ubuntu 或 Red Hat Linux 7 的睡眠和配置盖板电源设置

Summary: 遵循本文中所述的步骤,对安装了 Ubuntu 或 Red Hat Linux 7 的戴尔笔记本电脑禁用睡眠或配置盖板电脑设置。

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Instructions


禁用 Ubuntu 或 Red Hat Linux 7 的睡眠和配置盖板电源设置

禁用睡眠:

提醒:此禁用睡眠的方法还应适用于使用 systemd 管理服务的其他 Linux 操作系统。
  1. 按照以下步骤,打开您的特定操作系统的终端程序
    • 打开 Ubuntu 的终端程序图 1):

      HOW12691_en_US__2Open Terminal
      图 1:打开 Ubuntu 的终端程序

    • 使用 Ctrl + Alt + T 键盘命令打开 Red Hat Enterprise 7 的终端程序
    • 您也可以通过转到应用程序菜单,选择 Utilities(实用程序),然后从列表中选择 Terminal(终端),从而在 Red Hat Enterprise 7 中打开终端程序图 2):

      HOW12691_en_US__3Red Hat Enterprise 7 Terminal Utitilities
      图 2:从应用程序/实用程序菜单打开终端程序

    • 您还可以从主应用程序菜单中打开 Red Hat Enterprise 7 中的终端程序图 3):

      HOW12691_en_US__4Red Hat Enterprise 7 Terminal Applications
      图 3:从应用程序菜单打开终端程序

  2. 打开终端后,运行以下命令: # systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

启用睡眠:

  1. 打开终端程序
  2. 运行以下命令: # systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

配置盖板电源设置:

  1. 打开 /etc/systemd/logind.conf 文件进行编辑。
  2. 查找 #HandleLidSwitch=suspend 这一行。
  3. 删除行首的 # 字符。
  4. 将该行更改为下面所需的任一设置:
    • HandleLidSwitch=poweroff 在合上盖板时计算机关机
    • HandleLidSwitch=hibernate 在合上盖板时计算机休眠
    • HandleLidSwitch=suspend 在合上盖板时计算机挂起
    • HandleLidSwitch=ignore 不进行任何操作
  5. 保存该文件并通过键入 # systemctl restart systemd-login 重新启动服务以应用更改。

Article Properties


Affected Product

Red Hat Enterprise Linux Version 7

Last Published Date

16 Feb 2024

Version

7

Article Type

How To