关于 Gnome 登录界面和桌面占用两个 tty

https://bugzilla.gnome.org/show_bug.cgi?id=747339

GDM’s behavior was changed in 3.16 so that instead of running one X server on the login screen which is then transformed into the user’s session, we now start a new X session from within the user’s session, which means that we need to start the user’s session on another TTY/VT.

Note that when using fast user switching, you effectively got this behavior as well, with each user on a different TTY/VT. We just extended it to the first user to log in as well.

评论#20,转载如下。(2015-05)

Let me explain a bit more about why we did this.

Previously, we launched one X server as root, and then when you logged in, we “morphed” it into the session X server. If you went to fast user switching, we then launched a second X server on-demand.

For security reasons, and Wayland porting reasons, we now launch the X server and Wayland server within the user’s session, instead of starting one as root.

The way that we do this is that we launch two X servers, one for the gdm greeter session, and for the session user.

It would be entirely possible to tear-down the greeter after we’ve switched to the user session, it just requires a bit more code, but unfortunately it wouldn’t be possible to put both the greeter session and the user session on VT1, since we’d have to launch the user session first, and then tear down the greeter session, and we can’t be in that intermediate state while there are two X servers on the same VT at the same time.

I just forgot about the resource issues around keeping around two gnome-shell instances. I’ll have a chat with Ray to see if we want to tear down the greeter session and then launch it on demand for user switching / logout to save on resources.

给翻译一下嘛:confounded:

1 个赞

这不是主贴的翻译。自从主流发行版的 Xorg 取消 setuid root 后,同时运行多个 X server 就变得不可靠起来。由于一些常年未解决的问题,使得在切换虚拟终端时很容易出现 race condition 而使得其中一个 X server 崩溃。这使得桌面环境以及 Wayland compositor 开发者的工作变得更加困难,因为他们习惯于利用同时启动多个 X server 来调试自己的工作。