Home / Alt manpages / gdm-control(1)

  • gdm-control(1)
  • User command
  • linux

Set GDM's next logout action from an Openbox X session

You will use gdm-control to tell GDM what should happen when your current graphical session ends: do nothing special, shut down, reboot or suspend. You can also ask GDM to show the login screen for another user immediately. Allow about five minutes. You need Openbox's gdm-control command, an X session managed by GDM, and enough time to avoid an accidental power action.

This guide covers the command shipped with Openbox 3.6.1-12build5 on this machine. The local manual page is dated 8 April 2024, while the utility's action list is the authority for the installed binary. Run these commands as your normal desktop user. sudo is not a substitute for an active X session or a working GDM connection.

1. Confirm the installed command

Check which executable will run and print its built-in help. The help text is useful here because it shows the exact action names accepted by the binary:

$ command -v gdm-control
/usr/bin/gdm-control
$ gdm-control --help
Usage: gdm-control ACTION

Actions:
    --help        Display this help and exit
    --none        Do nothing special when the current session ends
    --shutdown    Shutdown the computer when the current session ends
    --reboot      Reboot the computer when the current session ends
    --suspend     Suspend the computer when the current session ends
    --switch-user Log in as a new user (this works immediately)

Checkpoint

If command -v finds nothing, stop here and install or enable the package through your normal system administration process. Do not copy a similarly named command from an untrusted location.

2. Choose the safe default

Use --none when ending the session should not trigger a special power action. This is also the recovery command if you previously selected shutdown, reboot or suspend but changed your mind before logging out:

$ gdm-control --none

The command normally prints nothing. It changes GDM's action for the session ending; it does not log you out by itself. Keep this command handy before testing any other action.

3. Schedule one power action for logout

Warning

The following actions can interrupt work and may lose unsaved data. Save documents first. Run only the one action you actually want, and use --none to clear it before ending the session if you are unsure.

CommandEffect when the session ends
gdm-control --shutdownShut down the computer
gdm-control --rebootRestart the computer
gdm-control --suspendSuspend the computer

For example, to arrange a reboot after you finish the current session:

$ gdm-control --reboot

There is no confirmation prompt in the installed utility. The important distinction is timing: these options arrange what happens when the current session ends, rather than immediately powering off the machine. Do not treat a silent return as proof that GDM accepted the request. Before logging out, run gdm-control --none if you need to cancel it.

4. Switch to another user immediately

Use --switch-user when you want GDM to present the login path for a new user now:

$ gdm-control --switch-user

This action is different from the power actions: the manual says it works immediately. Save work and check your desktop's session policy before using it. Depending on the display manager and session setup, your current session may remain available or may be handled by the normal user-switching workflow. The command does not create a user account or change account permissions.

5. Diagnose a command that appears to do nothing

gdm-control is designed to run from within an X session. A terminal reached through SSH, a text console, a Wayland-only environment or a session not managed by GDM may not provide the connection it needs. Check the session display and the display manager without changing power state:

$ printf 'DISPLAY=%s\n' "${DISPLAY-}"
DISPLAY=:0
$ command -v gdm-control
/usr/bin/gdm-control

An empty DISPLAY is a strong sign that you are not in the required X environment. A missing GDM connection can also produce a diagnostic such as:

Failed to establish a connection with GDM: No such file or directory

The exact diagnostic varies with the host. Do not add sudo just to silence it: elevated privileges do not create the X display or GDM service that the command expects. Return to a terminal inside the graphical session and check that GDM is the active display manager before trying again.

6. Verify the final state safely

The utility has no status action in its help output. Its normal successful use is quiet, and the command may still return a zero shell status when it cannot establish a GDM connection, so $? alone is not a sufficient verification:

$ gdm-control --none
$ printf 'shell status: %s\n' "$?"
shell status: 0

Use the action you intend, keep the terminal output, and verify the result through the next GDM logout or switch-user operation. If the requested power action did not occur, restore --none, keep the original session open, and investigate the X display and GDM connection rather than repeating a disruptive command.

Done means

  • You confirmed that /usr/bin/gdm-control is the installed Openbox utility.
  • You ran it from the intended GDM-managed X session.
  • You selected exactly one action and understood whether it is deferred until logout or works immediately.
  • You saved work before choosing shutdown, reboot, suspend or user switching.
  • You know that --none is the practical cancellation command and that a zero exit status does not prove a GDM connection.