Passer au contenu principal
  • Passer des commandes rapidement et facilement
  • Afficher les commandes et suivre l’état de votre expédition
  • Créez et accédez à une liste de vos produits

How to disable sleep and configure lid power settings for Ubuntu or Red Hat Linux 7 for Dell laptops

Résumé: Follow the steps outlined in this article to disable sleep or to configure the lid power settings for a Dell laptop with Ubuntu or Red Hat Linux 7 installed.

Cet article concerne   Cet article ne concerne pas 

Instructions


Disable sleep and configure lid power settings for Ubuntu or Red Hat Linux 7

Disable sleep:

NOTE: This method to disable sleep should also work on other Linux operating systems that use systemd for managing services.
  1. Open a Terminal following the steps below for your specific operating system:
    • Open a Terminal for Ubuntu (Figure 1):

      HOW12691_en_US__2Open Terminal
      Figure 1: Open Terminal for Ubuntu

    • Open a Terminal for Red Hat Enterprise 7 using the keyboard command of Ctrl + Alt + T.
    • You can also open a Terminal in Red Hat Enterprise 7 by going to the Applications menu, selecting Utilities, then Terminal from the list (Figure 2):

      HOW12691_en_US__3Red Hat Enterprise 7 Terminal Utitilities
      Figure 2: Open Terminal from Applications/Utilities menu

    • You may also be able to open a Terminal in Red Hat Enterprise 7 from the main Applications menu (Figure 3):

      HOW12691_en_US__4Red Hat Enterprise 7 Terminal Applications
      Figure 3: Open Terminal from Applications menu

  2. After opening a Terminal, run the following command: # systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Enable sleep:

  1. Open a Terminal .
  2. Run the following command: # systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

Configure lid power settings:

  1. Open the /etc/systemd/logind.conf file for editing.
  2. Find the line #HandleLidSwitch=suspend.
  3. Remove the # character at the beginning of the line.
  4. Change the line to either of the desired settings below:
    • HandleLidSwitch=poweroff to shutdown computer when lid is closed
    • HandleLidSwitch=hibernate to hibernate computer when lid is closed
    • HandleLidSwitch=suspend to suspend computer when lid is closed
    • HandleLidSwitch=ignore to do nothing to do nothing
  5. Save the file and restart the service to apply the changes by typing # systemctl restart systemd-logind.