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

Always use VT_OPENQRY #1896

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

Always use VT_OPENQRY #1896

wants to merge 3 commits into from

Conversation

Vogtinator
Copy link
Contributor

@Vogtinator Vogtinator commented Mar 17, 2024

There is no other way to reliably grab a VT for use.

+ bonus tty fix.

Draft because not tested yet.

sizeof(char *) wasn't the intention there.
There is no other way to reliably grab a VT for use.
The whole concept doesn't make sense with VT_OPENQRY.
@Vogtinator
Copy link
Contributor Author

The PR works, but does unfortunately not fix the issue. It's broken at a lower level, VT_OPENQRY lies. Even after systemd claims it started getty@ttyX, VT_OPENQRY still returns X as available!

From journalctl:

Mar 18 16:15:45 localhost.localdomain systemd[1]: Started Getty on tty1.
Mar 18 16:15:45 localhost.localdomain systemd[1]: Started Getty on tty2.
Mar 18 16:15:45 localhost.localdomain systemd[1]: Reached target Login Prompts.
Mar 18 16:15:45 localhost.localdomain systemd[1]: Starting Postfix Mail Transport Agent...
Mar 18 16:15:45 localhost.localdomain systemd[1]: Started Simple Desktop Display Manager.
...
Mar 18 16:15:45 localhost.localdomain sddm[1059]: Doing open /dev/tty0
Mar 18 16:15:45 localhost.localdomain sddm[1059]: Did VT_OPENQRY 2
Mar 18 16:15:45 localhost.localdomain sddm[1059]: Xauthority path: "/run/sddm/xauth_rpUCLS"
Mar 18 16:15:45 localhost.localdomain sddm[1059]: Using VT 2
...
Mar 18 16:15:46 localhost.localdomain sddm[1059]: Doing open /dev/tty0
Mar 18 16:15:46 localhost.localdomain sddm[1059]: Did VT_OPENQRY 1
Mar 18 16:15:46 localhost.localdomain sddm[1059]: Session "/usr/share/wayland-sessions/plasmawayland.desktop" selected, command: "/usr/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland" for VT 1

@Vogtinator
Copy link
Contributor Author

Even after systemd claims it started getty@ttyX, VT_OPENQRY still returns X as available!

Apparently getty@.service has Type=idle which means it is marked as active before anything actually happened. I don't see a way to fix this.

@Vogtinator
Copy link
Contributor Author

Even after systemd claims it started getty@ttyX, VT_OPENQRY still returns X as available!

Apparently getty@.service has Type=idle which means it is marked as active before anything actually happened. I don't see a way to fix this.

Reported as systemd/systemd#31909

@ftiede
Copy link

ftiede commented Apr 4, 2024

Sorry to mention this, but there is a reason I fixed #1650: I want sddm to run on a specific VT. Removing the feature entirely renders SDDM unusable for me.
Essentially this PR means I need to revert it completely in the future.

@Vogtinator
Copy link
Contributor Author

Vogtinator commented Apr 4, 2024

Sorry to mention this, but there is a reason I fixed #1650: I want sddm to run on a specific VT. Removing the feature entirely renders SDDM unusable for me.

The option to use a specific VT only ever works in the specific case of rootful X with an X desktop inside, everything else needs dynamic allocation.

You can influence dynamic allocation to reserve lower VTs though and get SDDM to use a specific one that way.

@Vogtinator
Copy link
Contributor Author

I plan to make some changes to this PR anyway (open the tty in the daemon process), which should make it easier to reintroduce SDDM_INITIAL_VT in a way that actually works though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants