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 的 Dell 筆記型電腦停用睡眠與設定上蓋電源設定

Summary: 遵循本文所概述的步驟,為安裝 Ubuntu 或 Red Hat Linux 7 的 Dell 筆記型電腦停用睡眠與設定上蓋電源設定。

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 的終端機
    • 您也可以前往「應用程式」功能表,選取公用程式,然後在清單中選取終端機,以開啟 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-logind 儲存檔案並重新啟動服務,以套用變更。

Article Properties


Affected Product

Red Hat Enterprise Linux Version 7

Last Published Date

16 Feb 2024

Version

7

Article Type

How To