Auteur: Andreas Messer Datum: Aan: dng Onderwerp: Re: [DNG] [ASCII][PATCH] startx to a new tty
Hello Dario,
On Wed, Sep 12, 2018 at 03:28:23PM +0200, Dario Niedermann wrote: > Hello! After trying Devuan ASCII, I noticed a problem with `startx' that
> I never had before: the X server occupies the same tty where `startx'
> was issued. It should allocate the first unused tty instead
> (default: tty07).
Well, this is not really a Devuan Problem. It is more likely related
to session management present in most modern linux distros.
> === Why it is a problem ===
>
> Once you quit X, the tty is no longer owned by you, but by root.
> If, for example, you try to reattach to a `screen' session,
> that will fail. Also, losing a logged-in tty during the X11 session
> can be inconvenient.
This can only happen when running X as root. But with new session
management, X normally does not with root permissions.
> [...]
> The added conditional was copied from another systemd-less distro
> (VoidLinux, possibly it got there from somewhere upstream).
> I also comment out a '-keeptty' option that was in the Devuan version
> (but those lines are no longer being executed anyway).
The point here is, Devuan has also session management. Its based on
elogind or consolekit. It should not be tested for presence of some
directories, it should be tested if session is registered with one of the
session management services. And it should be tested if x will be running
with root permissions.
> The Devuan 'Xwrapper.config' file wasn't setting the 'needs_root_rights'
> variable. So, the patched `startx' would lack permission to allocate
> the first available tty, and it would fail - except when issued by root.
This is a site specific configuration. Its matter of site admin to decide
on this. From (Devuan) maintainers view, the setting should be the least
permissive one.
As indicated with one of your links, this "keep-tty" stuff was introduced
to properly handle session management. Without the X-Session from "startx"
will considered "inactive" by session management and in turn several things
wont work as expected. E.g. udisks based mounting of Filessystems - This
covers for example Plug and Play use of USB-Sticks.
If you like to use your system like that, you're free to do so, but the
expectation of other Devuan users might be different. Not all of them are
advanced Linux users, they just want use it.