Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

13.11. Changing Behavior when Pressing the Power Button in Graphical Target Mode

When the machine is booted to a graphical login screen or user session, hitting the power button makes the machine suspend by default, in Red Hat Enterprise Linux 7. This happens both in cases when the user presses the power button physically or when pressing a virtual power button from a remote console. To achieve a different behavior when pressing the power button, set the functions of particular buttons with dconf.
This section shows how to configure the system to shutdown after pressing the power button, which corresponds to the behavior present in Red Hat Enterprise Linux 6.

Procedure 13.11. Setting the behavior when pressing various buttons

  1. Create a local database for system-wide settings in the/etc/dconf/db/local.d/01-power file:
  2. Override the user's setting and prevent the user from changing it in the /etc/dconf/db/local.d/locks/01-power file:
  3. Update the system databases:
    # dconf update
  4. Users must log out and back in again before the system-wide settings take effect.
This configuration initiates a system shutdown after pressing the power button. To configure the system differently, you can set the behavior of particular buttons.

Options for particular buttons

does nothing
shows a pop-up query asking the user what to do
hibernates the system
terminates the session and logs the user out
does nothing
starts a standard shutdown procedure
suspends the system