Drop server generations #424
Replies: 2 comments · 10 replies
|
On the xlibre mailing list, this mail was posted: When I proposed if we should remove X server generations, I meant to just keep the server running and fully initialized after the last client disconnects, not to kill the X server after the last client disconnects. I often use the X server is such a way that the last client disconnects, and I suspect many others do, if perhaps without realizing it. When playing games from steam, I do the following: The way steam is designed, if first starts an X client that checks and does any updates. So I do rely on the feature that the X server survives the last client closing. |
All reactions
|
@smj-cc The server segfaults on reset? Are you using the nvidia proprietary DDX? |
All reactions
|
Nope, |
All reactions
|
Here is the actual server log: |
All reactions
|
@smj-cc @stefan11111 Could you please track this problems in a new issue at Issues - X11Libre - GitHub? So we focus on the server generations aspect in this discussion. |
All reactions
That's actually the default case. If one wants the Xserver to terminate (eg. on multi-user systems, when started by a display manager), there's already the "-terminate" flag. This discussion is only about dropping the "-reset" and "-noreset" flags and only keeping the "-noreset" case. Those who do want the Xserver to be reset after last client gone now need to use "-terminate" and take care of restarting the Xserver process (IMHO, most display managers already doing that). By that we can get rid of lots of complexity for partial re-initializations (that also needs to track whether server generation changed) in many places. The server generation now always will be 1.
That means it won't work well when directly launched from a display manager, without any extra session manager client (kiosk mode). Wonder why they haven't considered that case - maybe they expect folks to use some little extra session init tool, that's keeping the X session open. BUT: this really doesn't make any trouble here, because we're not going to mandate the Xserver being killed after last client gone.
That's exactly what the whole discussion is about :) |
All reactions
|
My question is: Why restart a fully initialized (X) server after all? What is the motivation behind this? And how does this fare with any attempts to drop root privileges after the X server start = initialization phase? |
All reactions
|
That's an old relic from public X11 workstations / Terminals: a) for security reasons, all user-visible resources (eg. atoms, root window properties, etc) should be cleared, so different people using the same X server one after another can harm each other Criteria b) and c) are totally gone for aeons now. And a) can be easily achieved by using -terminate flag and restart the Xserver process if desired (eg. present login screen after user logged out). IIRC, most display managers already doing that. |
All reactions
|
Thank you! I understand. Regarding a): I was thinking of a method to keep a long-running X server in a somewhat defined state even after client disconnects and without termination. Simplifying the X server to "just" a server like, say, any other web server. Never heard of having to shut down the latter after a client disconnects. ;-) So I came up with the idea to clean up the resources (atoms, root window properties, etc.) after a client disconnects. This would require:
Would the tracking of 2 be feasible? If so, it could be possible to clean up all the client-specific resources after a client disconnect. And therefore reduce or even eliminate the need to "regenerate" or terminate the X server after all. What do you think? |
All reactions
This is what we currently have - and it's complicated and error-prone. We already had those kind of bugs recently.
It's actually not uncommon for Unix services. Classic base inet services are actually doing exactly that - and they're not even creating the listener socket themselves, instead let inetd to it (and inetd spawns one process per connection).
Wouldn't help much, because it's perfectly valid that clients just setting some properties and then terminating. In fact, that internal-reset thing never had been part of any X11 standard, just an xfree86 specific hack.
client-specific resources (those owned by a client) are already cleaned when owning client terminates. The whole reset thing is nothing but a hack for gaining a little bit or restart speedup - back when that could take really long. |
All reactions
|
Thanks and 👍 for the removal! |
Uh oh!
There was an error while loading. Please reload this page.
Describe the idea
The Xserver still has an historical concept of "server generations": when the last client is gone, the server goes through an internal reset (all client/user-visible state is cleared) and then coming back in a new "generation". That's coming from the era of old multiuser workstations, where a full server restart (w/ graphics init, etc) was slow - when one just logged out and wants to re-login as another user, one didn't want to wait minutes.
Today, it all takes less than a second. And practically happening only rarely.
Note that it's just for cases where really one logs out and immediately wants to re-login on the same seat and VT (not starting a second Xserver in parallel), and not wanting to spend less than one second extra time.
It should be done because
The whole machinery is pretty complex and tends to cause trouble (eg. X11Libre/xserver#1315).
And once that's out ouf the way, there're still plenty options to improve startup times.
What are the alternatives?
No response
Additional context
No response
Extra fields
All reactions