On Tue, Mar 3, 2026 at 1:28 AM William L. Thomson Jr <[email protected]> wrote:
> On Mon, 2026-03-02 at 11:32 -0500, Adrian Vovk wrote:
> > Hello,
> >
> > You mentioned up the email chain that there is no misconception.
> > There _is_ a misconception. That is becoming increasingly clear.
>
> Yes, so lets speak in code.
>
> > A logind session is not a service. It is not a program that runs. You
> > can't talk to it via PID because there's nothing logind related on
> > that PID. There's no such thing as connecting to a logind session.
>
> Code says otherwise.
>
>
> ret = sd_pid_get_session(pid, &session_id);
> if (ret < 0)
> {
> PT("Failed to get session for PID %d: %s", pid, strerror(-
> ret));
> return NULL;
> }
>
>
That's not what it says, no. It shows the opposite relationship: a session
may "own" a set of processes – it is not run by any of those processes.
One of those processes is considered to be the "session leader" by logind
(these days it's gdm-session-worker, previously it could be gnome-session
directly), but that's relevant only as far as its existence (if the leader
exits, the session is considered abandoned); the leader does not
communicate with logind in any specific way and is just the root of the
session's process tree.