LinuxCommandLibrary

gdm-safe-restart

Restart GDM display manager safely

TLDR

Restart the GNOME Display Manager application when all users have logged out

$ gdm-safe-restart
copy

SYNOPSIS

There is no direct command named gdm-safe-restart with specific syntax or options. The functionality implied by this term is typically achieved through service management commands.

Common alternatives for restarting GDM:
sudo systemctl restart gdm
sudo systemctl restart gdm3 (for some distributions)
sudo systemctl isolate graphical.target (moves to graphical.target, effectively restarting GDM if already in graphical mode)

PARAMETERS

N/A
    As 'gdm-safe-restart' is a conceptual action and not a direct command, it does not have specific command-line parameters.

DESCRIPTION

The phrase "gdm-safe-restart" refers to the concept of restarting the GNOME Display Manager (GDM) in a controlled manner, typically to recover from a frozen graphical environment, apply display server configuration changes, or resolve display-related issues without requiring a full system reboot. It is important to note that "gdm-safe-restart" is not a direct, standalone command with its own executable and man page in most modern Linux distributions.

Instead, the functionality implied by "gdm-safe-restart" is usually achieved by interacting with the system's service manager, such as systemd, to restart the GDM service. The term "safe" implies an attempt to minimize disruption, though restarting GDM will inevitably close all active graphical sessions managed by it, potentially leading to data loss in unsaved applications for logged-in users. It's often used by system administrators or power users for troubleshooting graphical desktop environments.

CAVEATS

Restarting GDM, even with the intent of a "safe restart," will terminate all active graphical user sessions managed by GDM. This means any logged-in users will be logged out, and unsaved work in graphical applications will be lost. This action should only be performed when necessary and with an understanding of its consequences. It does not prevent loss of data for users who are actively working in the graphical environment.

ACHIEVING 'GDM SAFE RESTART'

To achieve the intended effect of a 'gdm-safe-restart', users typically utilize systemd commands. For most systems running GNOME, the GDM service is named 'gdm.service' or 'gdm3.service'. The most common command to restart it is:

sudo systemctl restart gdm

On some Debian/Ubuntu based systems, it might be:

sudo systemctl restart gdm3

Another method, less direct but can achieve a similar outcome by switching runlevels/targets, is:

sudo systemctl isolate graphical.target

This command transitions the system to the graphical target, which will start GDM if it's not running, or restart it if it's already part of the target's dependencies and a refresh is needed.

Historically, before systemd, one might have used init commands or direct kill signals to X processes, but these methods are generally deprecated and less safe.

WHEN TO USE

'GDM safe restart' is typically used in scenarios such as:
- When the graphical environment freezes or becomes unresponsive.
- After making certain configuration changes that require the display server to restart (e.g., driver updates, Xorg configuration).
- To recover from a crashed X server without affecting other services or requiring a full system reboot.

HISTORY

The concept of "safe restart" for display managers has roots in older Unix/Linux systems where X server crashes were more common, and direct ways to restart X or the display manager were sought without a full system reboot. While the specific phrase "gdm-safe-restart" might have appeared in various recovery scripts or forum discussions over time, it never materialized as a standardized, dedicated command. Modern Linux distributions primarily rely on systemd for service management, making commands like systemctl restart gdm the contemporary and robust method to achieve this functionality.

SEE ALSO

systemctl(1), gdm(8), gdm3(8), Xorg(1)

Copied to clipboard