Skip to content

VT switching, sd_pid_get_session and sd_uid_get_graphical for systemd based sessions #12399

Description

@benzea

Unfortunately, there seems to be some confusion as to which session processes belong to when they are started through systemd. This currently means for example that we cannot VT switch if we start gnome-shell using systemd, as the DBus call fails with:

Caller does not belong to any known session

As sd_pid_get_session cannot work in this case, GNOME is adding code in various places to instead use sd_uid_get_display with a fallback to iterating the session and also including ones of type greeter(in mutter) or iterating users sessions to find the oldest graphical one (e.g. in gnome-session).

It seems like logind itself needs the same kind of heuristics to allow gnome-shell/mutter to do VT switching when it is being launched through systemd. sd_uid_get_display cannot currently be used for this because greeter type session are excluded.

I imagine that this heuristic could be public API.

CC: @smvc, @ iainlane

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions