Skip to content

"Execution of 'gdmflexiserver' failed" notification when switching users (LightDM misidentified as GDM) #8488

@Susensio

Description

@Susensio

Applet version/Build date

1.2

Cinnamon version

6.6.7

Distribution

22.3

Graphics hardware and driver used

Intel GeminiLake [UHD Graphics 600] i915 kernel

Applet name and maintainer

sessionManager@scollins @collinss

What happened?

Hello,
When using the "Switch User" function on Linux Mint with LightDM, a system notification appears stating: Execution of 'gdmflexiserver' failed. Immediately after the notification, the system falls back to the Cinnamon lock screen user switcher.

I looked into the source code and found the root cause. The display manager detection logic is misidentifying LightDM as GDM due to the order of the checks.

The code checks for GDMSESSION before checking for XDG_SEAT_PATH or the default-display-manager file:

//check display manager
if ( GLib.getenv("MDMSESSION") ) display_manager = "mdm";
else if ( GLib.getenv("GDMSESSION") ) display_manager = "gdm";
else if ( GLib.getenv("XDG_SEAT_PATH") ) display_manager = "lightdm";
else {
if ( GLib.file_test("/etc/X11/default-display-manager", GLib.FileTest.EXISTS) ) {
Util.spawn_async(["grep", "-oE", "\"[^/]+$\"", "/etc/X11/default-display-manager"], Lang.bind(this, function (output) {
display_manager = String(output).split("\n")[0];
}));
}
else {
let found = false;
for ( let file of ["/etc/systemd/system/display-manager.service", "/etc/systemd/system-display-manager.service"] ) {
if ( GLib.file_test(file, GLib.FileTest.EXISTS) ) {
found = true
Util.spawn_async(["grep", "-e", "\"Exec\"", file], Lang.bind(this, function (output) {
display_manager = String(output).split("/").pop().split("\n")[0];
}));
}
}
if ( found ) global.log("Unable to determine display manager");
}
}
}

On my system, the environment looks like this:

$GDMSESSION=cinnamon
$XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
cat /etc/X11/default-display-manager # returns /usr/sbin/lightdm

Because the LightDM/Cinnamon session populates GDMSESSION=cinnamon for legacy compatibility:
https://github.com/ubuntu/lightdm/blob/5f14752419fc7f0fd763013c8195dcb0099c940a/src/seat.c#L996
the else if ( GLib.getenv("GDMSESSION") ) check passes first. The applet sets display_manager = "gdm" and subsequently tries to execute gdmflexiserver when switching users, causing the error notification.

Proposed Solution:
Reordering the conditional block to check /etc/X11/default-display-manager or XDG_SEAT_PATH before GDMSESSION would correctly identify LightDM, at least in my system, allowing the applet to use the proper dm-tool switch-to-greeter command natively.

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions