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.

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

Summary: 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.

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


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.

Article Properties


Last Published Date

16 Feb 2024

Version

7

Article Type

How To