LinuxCommandLibrary

gdmflexiserver

Launch flexible GDM login server

SYNOPSIS

gdmflexiserver
(reads single command line from stdin)

DESCRIPTION

The gdmflexiserver command is a lightweight utility within the GNOME Display Manager (GDM) ecosystem, designed to start Xorg (or compatible) servers dynamically. Invoked internally by GDM, it reads exactly one line from standard input representing the complete X server command line, such as Xorg :1 vt2 -auth /var/lib/gdm/:0.Xauth -nolisten tcp.

Upon reading the input, gdmflexiserver tokenizes it into arguments and configures essential environment variables:
DISPLAY: Derived from the DISPLAY_MANAGER_REQUEST env var (e.g., 1 becomes :1).
XAUTHORITY: Set to GDM's authority file (typically /var/lib/gdm/:0.Xauth or seat-specific).
GDMSESSION, DESKTOP_SESSION, RUNNING_UNDER_GDM: Flags for session awareness.

It then invokes execvp() on the first token (server binary) with the full argument list, effectively handing off control to the X server. This mechanism supports advanced GDM features like multi-seat configurations, XDMCP remote logins, and local virtual terminals without rigid scripting.

Not meant for manual execution, as it relies on GDM's precise environment and stdin piping. Failure to provide correct input results in immediate exit. Primarily used on X11; Wayland support in modern GDM reduces reliance on it.

CAVEATS

Internal GDM tool; direct use requires GDM env vars (e.g. DISPLAY_MANAGER_REQUEST) and valid stdin command or it exits silently.
Typically runs as root; security-sensitive.
May be absent or deprecated in Wayland-only GDM setups.

TYPICAL GDM INVOCATION

GDM pipes via:
printf '%s\0' "Xorg :1 -seat seat0 vt2 -auth $XAUTHORITY" | gdmflexiserver
Exports DISPLAY_MANAGER_REQUEST=1 beforehand.

SOURCE BEHAVIOR

C program (~200 LOC); tokenizes stdin line (max 10KB), ignores empty input, sets ~15 env vars, execvp()s server. No command-line options for simplicity.

HISTORY

Introduced in GDM 2.4 (circa 2004) for dynamic X server management in multi-display/XDMCP scenarios. Persists in GDM 3.x/40+ for X11 backward compatibility, but systemd-logind and Wayland integration (gdm-wayland-session) diminish its role since ~2016.

SEE ALSO

gdm(8), Xorg(1), xdm(1)

Copied to clipboard