I found this bug report from Cendio, relevant to my ongoing experiments with ThinLinc.
@samuel initially suggested using the info returned by loginctl list-sessions for detecting potentially conflicting sessions (see comment 18). I understand that you’ll be implementing this differently, but can you clarify the logic you intended to apply on the info obtained from loginctl?
As it looks right now, we’ll be using libsystemd (statically linked) directly to grab information regarding currently existing sessions (instead of calling loginctl). With this information in hand, we replicate the behavior of modern GDM to inform users that a “conflicting” session is already running. That’s how it looks right now, at least.
Note that we won’t be doing any such checks if multisession is turned on (i.e. /vsmserver/max_sessions_per_user != 1). We are also trying to avoid making systemd a hard dependency.
Do you have any more information to share about your current experiments? Niche questions like this generally pique our interest .
Thanks @wilsj, that’s indeed what I recall from reading the rest of the bug report.
What I’m really after is the equivalent logic using loginctl instead (or anything else I can access from the terminal), so I can get a sense already today for what will formally qualify as a problematic setup in the future (i.e. a situation with those “conflicting” sessions).
I’m currently trying out variations of the approach suggested in this blog post on a Fedora 43 + i3wm workstation. It looks promising, but I suspect everything I’ve tested so far involves conflicting sessions. So if I can get more details about how you initially intended to use the loginctl info to detect conflicting sessions, I could be more certain, and maybe derive a more robust setup based on those rules.
(I guess an easy way to stay out of trouble would be to create a user exclusively for ThinLinc access, but I’m hoping there’s a more elegant solution.)
More specifically, we are checking if there are any sessions belonging to a given user that have their Type-property set to one of [x11, wayland, mir], this is similar to what GDM does to check if a session is a graphical session.
With loginctl you could run loginctl show-session <sessnum> --property=Type --value and check its output.
So put in another way: for the approach suggested in the Cendio blog post to “pass” the upcoming multiple session test (and without resorting to set up multiple user accounts for the same physical user), no display manager or desktop environment / window manager can be in use when the ThinLinc session starts. Correct?