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).
Now, if you have no problem with that, you may disregard the rest of this message. If it's not even happening to you, I'd be interested in comparing notes. === 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. === Origin === It might be that the `startx' script -- and possibly the 'Xwrapper.config' file -- were altered upstream, taking for granted the presence of systemd. The following patch changes these 2 files as needed, in order for `startx' to work correctly and traditionally, without systemd. ------------------------------------------------------------------------ Vvv====P:A:T:C:H===F:O:L:L:O:W:S====**====T:H:I:S===S:I:D:E===U:P======= ======================================================================== -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 NotDashEscaped: You need GnuPG to verify this message devuan-startx-newtty patch by <da...@darioniedermann.it> 12-Sep-2018 === How to apply this patch === # cd / && patch -p1 < /path/to/devuan-startx-newtty.patch There is no need to trim any text, before or within the patch itself: the `patch' program knows what to skip. === Part 1 === A conditional is added to `startx' to check for the presence of systemd. If the conditional fails, the nested block will not be executed. On Devuan, that amounts to removing the 5 lines now encased in the conditional. Those lines were responsible for passing `xinit' (and in turn `Xorg') a 'vt' option followed by the current tty number. We must avoid that, if we want a new tty. 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). --- /usr/bin/startx.orig 2015-10-19 03:54:32.000000000 +0200 +++ /usr/bin/startx 2018-09-11 21:18:14.812510159 +0200 @@ -104,10 +104,12 @@ # When starting the defaultserver start X on the current tty to avoid # the startx session being seen as inactive: # "https://bugzilla.redhat.com/show_bug.cgi?id=806491" - tty=$(tty) - if expr match "$tty" '^/dev/tty[0-9]\+$' > /dev/null; then - tty_num=$(echo "$tty" | grep -oE '[0-9]+$') - vtarg="vt$tty_num -keeptty" + if [ -x /usr/lib/systemd/systemd -o -x /lib/systemd/systemd ]; then + tty=$(tty) + if expr match "$tty" '^/dev/tty[0-9]\+$' > /dev/null; then + tty_num=$(echo "$tty" | grep -oE '[0-9]+$') + vtarg="vt$tty_num" # -keeptty" + fi fi === Part 2 === 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. --- /etc/X11/Xwrapper.config.orig 2018-09-09 07:46:44.216064832 +0200 +++ /etc/X11/Xwrapper.config 2018-09-11 22:38:43.086092849 +0200 @@ -13,3 +13,4 @@ # again, run the following command as root: # dpkg-reconfigure xserver-xorg-legacy allowed_users=console +needs_root_rights = yes -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJbmO3DAAoJEPJFaEEGrTgGYZEP/iPkZ8VTXveSOvmgbFIxiL1m p9oq0oKPlK+/rO0i6hheNPzylgnddvRNgpp0vrrnJPYFK9KCFBC1R4j3ePNJawPu 8ysnDDwWtjxdg7t8rDtRH0JEwDY+FPv+EqBxTb65wULGpjwG302FpjXr7LmlJzJP PCPSO5flIjJ+RzCfmp2BK/sP2N498bcO+vQcKkv0bTAJ/sIsHHnbEnPxilKjeb1Q EwGZKBRTn61OTE7x+Jh0pzFoBeZaIsrCmu+BjwphQ3meOiCZq+PDFO5VgbhsrGLv tpP15awlXAQdR8GGxj6fAOfqlMJ59cwbHpwuI5CfPhIrrQDjMmUgW3X6ifxNqK9x 7L5kcc8OeqYLFcd0u8IawxGEIiWmaO+M/WKTVsd+pqjGqPfWk6JvAcrMoFwMmjQG iWa7D0dO0xGJayuyBwBMo/hBxgeCAjDh0ij9hEC8QJ4WEOXfxIgDuGx6zxurAyst vcguMdNNfU+552Zc/58dq79+e3gG+5DY+fIXUAV0PvAH3FdrSAnUEpbNBS+bhJ3o Il8P3NnQDBxNzx8QxpUojMiinooFqDBAboM78Rio7qil+ZF5cyFZ2fP5fwRk9NOg jjLlnicyvFyT0oGb5WK/y5O0pagb3J2T31Apz+TaLzg/EdW51826kNGSCCw/B/+q +cj4iYqOcoJR/erfxCfo =xj6f -----END PGP SIGNATURE----- ==================================================END==OF==PATCH=*=*=*** -- Dario Niedermann. Also on the Internet at: gopher://darioniedermann.it/ <> https://www.darioniedermann.it/ _______________________________________________ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng