Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Declare that non-seat0 seats can support multisession. #15337

Merged
merged 1 commit into from Apr 10, 2020

Conversation

n3rdopolis
Copy link
Contributor

As talked about on the mailing list, multisession support does
work on nont-seat0 seats, but logind undersells this ability
and onlt sets CanMultiSession on seat0 with TTYs. This is because
seat_can_tty acts the same way as seat_can_multi_session() as and
only reports that the seat has TTYs, which hasn't been needed to
support multi session switching on non-seat0 seats since I tested
it first in at least 2017

@poettering
Copy link
Member

Hmm, what about seat0 there? Maybe we should return false for it, in case the VT subsystem is turned off in the kernel?

@dvdhrm any idea why you claimed that CanMultiSession was false for all non-seat0 sessions back when you added multi-session support without VT to that?

@dvdhrm
Copy link
Contributor

dvdhrm commented Apr 7, 2020

Hmm, what about seat0 there? Maybe we should return false for it, in case the VT subsystem is turned off in the kernel?

@dvdhrm any idea why you claimed that CanMultiSession was false for all non-seat0 sessions back when you added multi-session support without VT to that?

I never changed the logic. This is still from the original commit. I merely did some refactoring. I think this originates in:

commit addedec48ba0ffc4472ef6d3b5a45c9d4239f1cd
Author: Lennart Poettering <lennart@poettering.net>
Date:   Tue Jan 3 21:47:54 2012 +0100

    logind: if we can't open /dev/tty0, assume there is no VT subsystem and don't pretend we could do VT switching

Anyway, I did definitely introduce multi-session support for all seats. No idea why I never adjusted can_multi_session(). But this function is also not used by anything, right? So I think it would mostly be a cosmetic change.

I do agree, the correct thing would be to return true unconditionally. We should probably still write CAN_MULTI_SESSION into the logind state file, to make sure sd-login can read it correctly. But the seat_can_multi_session() function should just be dropped entirely.

@n3rdopolis
Copy link
Contributor Author

Are you sure it can be dropped? Because I see
src/login/logind-seat-dbus.c:static BUS_DEFINE_PROPERTY_GET(property_get_can_multi_session, "b", Seat, seat_can_multi_session);
unless I am overlooking something... ...or you want that to just be changed to true too.

@dvdhrm
Copy link
Contributor

dvdhrm commented Apr 8, 2020

Are you sure it can be dropped? Because I see
src/login/logind-seat-dbus.c:static BUS_DEFINE_PROPERTY_GET(property_get_can_multi_session, "b", Seat, seat_can_multi_session);
unless I am overlooking something... ...or you want that to just be changed to true too.

I mostly meant changing seat_can_multi_session() to return true unconditionally, and then taking it from there and simplifying the callers. But feel free to leave it around. I am not sure whether sd-bus allows returning constants from BUS_DEFINE_PROPERTY. And I definitely did not check all the call sites.

The only thing we need to be careful about is sd-login, since we don't want it to break during live-updates. So I would keep writing the CAN_MULTI_SESSION property in logind and I would keep sd-login as it is.

@n3rdopolis
Copy link
Contributor Author

ah. makes sense. I have it changing seat_can_multi_session() now, to return true, so is this what you want? Or should I change something else like the commit message or something?

@dvdhrm
Copy link
Contributor

dvdhrm commented Apr 8, 2020

ah. makes sense. I have it changing seat_can_multi_session() now, to return true, so is this what you want? Or should I change something else like the commit message or something?

That is up to the systemd maintainers to decide. I recommend dropping the [RFC] prefix, describing the discussion-outcome in your commit-message and simplifying the call-sites if possible.

@n3rdopolis
Copy link
Contributor Author

Should I close this, and open a new one with the change message? not sure how in github to change the commit message...

@poettering
Copy link
Member

just force push the new version of your commit over the existing branch

@n3rdopolis
Copy link
Contributor Author

Ok, I think I figured it out

@poettering
Copy link
Member

Could you add a comment saying "All our seats can do multi-session these days" or so to the function, to indicate this is mostly a historical artifact?

@n3rdopolis
Copy link
Contributor Author

Let me know if that comment is good enough

Copy link
Contributor

@dvdhrm dvdhrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks a lot!

@poettering poettering merged commit fa2cf64 into systemd:master Apr 10, 2020
@poettering
Copy link
Member

@dvdhrm thanks for the review!

keszybz added a commit to keszybz/systemd that referenced this pull request Apr 17, 2020
Follow-up for fa2cf64.
Backwards-compat is retained. A short note is added in docs, in case
people see sd_seat_can_multi_session() mentioned somewhere and wonder what
happened to it.

Also see systemd#15337 (comment).
keszybz added a commit to keszybz/systemd that referenced this pull request Apr 17, 2020
Follow-up for fa2cf64.
Backwards-compat is retained. A short note is added in docs, in case
people see sd_seat_can_multi_session() mentioned somewhere and wonder what
happened to it.

Also see systemd#15337 (comment).
Yamakuzure pushed a commit to elogind/elogind that referenced this pull request Aug 31, 2020
Follow-up for fa2cf64a917d31605d40d34e98ce9e2e066064fa.
Backwards-compat is retained. A short note is added in docs, in case
people see sd_seat_can_multi_session() mentioned somewhere and wonder what
happened to it.

Also see systemd/systemd#15337 (comment).
gnomesysadmins pushed a commit to GNOME/gnome-flashback that referenced this pull request Sep 4, 2020
All seats supports multiple sessions:
systemd/systemd#15337
systemd/systemd#15459

sd_seat_can_multi_session function has been deprecated and always
returns true with systemd 246 or newer.

Also CanMultiSession property no longer appears in D-Bus
introspection data. This might have revealed bug somewhere as
now generated gf_login_seat_gen_get_can_multi_session function
returns false but property is supposed to be always true.

Above causes user switch button to be hidden. As all seats should
support multiple session remove can_multi_session check to restore
user switch button in unlock dialog.
gnomesysadmins pushed a commit to GNOME/gnome-panel that referenced this pull request Sep 4, 2020
All seats supports multiple sessions:
systemd/systemd#15337
systemd/systemd#15459

sd_seat_can_multi_session function has been deprecated and always
returns true with systemd 246 or newer.
rhansen added a commit to rhansen/lightdm that referenced this pull request Apr 20, 2023
This should work now that seat_local_get_active_session returns the
proper value for non-seat0 seats.

Note: systemd-logind v245 and older erroneously report
CanMultiSession=no on non-seat0 seats even when it is supported.  This
change will break those users.  See
<systemd/systemd#15337>.
rhansen added a commit to rhansen/lightdm that referenced this pull request Apr 20, 2023
This should work now that seat_local_get_active_session returns the
proper value for non-seat0 seats.

Note: systemd-logind v245 and older erroneously report
CanMultiSession=no on non-seat0 seats even when it is supported.  This
change will break those users.  See
<systemd/systemd#15337>.
rhansen added a commit to rhansen/lightdm that referenced this pull request Apr 22, 2023
This should work now that seat_local_get_active_session returns the
proper value for non-seat0 seats.

Note: systemd-logind v245 and older erroneously report
CanMultiSession=no on non-seat0 seats even when it is supported.  This
change will break those users.  See
<systemd/systemd#15337>.
rhansen added a commit to rhansen/lightdm that referenced this pull request Apr 24, 2023
This should work now that seat_local_get_active_session returns the
proper value for non-seat0 seats.

Note: systemd-logind v245 and older erroneously report
CanMultiSession=no on non-seat0 seats even when it is supported.  This
change will break those users.  See
<systemd/systemd#15337>.
rhansen added a commit to rhansen/lightdm that referenced this pull request Apr 25, 2023
This should work now that seat_local_get_active_session returns the
proper value for non-seat0 seats.

Note: systemd-logind v245 and older erroneously report
CanMultiSession=no on non-seat0 seats even when it is supported.  This
change will break those users.  See
<systemd/systemd#15337>.
rhansen added a commit to rhansen/lightdm that referenced this pull request Apr 26, 2023
This should work now that seat_local_get_active_session returns the
proper value for non-seat0 seats.

Note: systemd-logind v245 and older erroneously report
CanMultiSession=no on non-seat0 seats even when it is supported.  This
change will break those users.  See
<systemd/systemd#15337>.
rhansen added a commit to rhansen/lightdm that referenced this pull request Apr 27, 2023
This should work now that seat_local_get_active_session returns the
proper value for non-seat0 seats.

Note: systemd-logind v245 and older erroneously report
CanMultiSession=no on non-seat0 seats even when it is supported.  This
change will break those users.  See
<systemd/systemd#15337>.
robert-ancell pushed a commit to canonical/lightdm that referenced this pull request Apr 28, 2023
This should work now that seat_local_get_active_session returns the
proper value for non-seat0 seats.

Note: systemd-logind v245 and older erroneously report
CanMultiSession=no on non-seat0 seats even when it is supported.  This
change will break those users.  See
<systemd/systemd#15337>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants