[SOLVED] systemd incursion! ( fix X starting on same vt )
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
systemd incursion! ( fix X starting on same vt )
I have noticed that starting X using startx runs X on the same vt as where it started from, instead of the usual vt7, also specifying a particular virtual terminal with
Code:
startx :1 vt6
For instance is ignored which is a pain as you can't see any X errors in the vt until you quit X, did a little exploring and found that startx had been patched to accomadate what seems to be a firefox/systemd bug here: https://bugzilla.redhat.com/show_bug.cgi?id=806491
As I don't ( and hopefully never wil have that systemd rubbish - I wanted to use a stronger word than that - on my system ). found that you can just comment out the relevent bits like so from around line 104 of /usr/bin/startx change
Code:
# 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"
fi
To this:
Code:
# 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"
# fi
You can then start X with startx the 'proper' way or specify a specific vt as above.
For a lot of users this is going to go unnoticed but if you do any low level X stuff getting at the error's form X will now be restored.
You will of course have to edit /usr/bin/startx as root, you may also want to make a backup first like so:
Code:
cp /usr/bin/startx /usr/bin/startx.BAK
In case anything goes really wrong.
Last edited by Keith Hedger; 04-06-2015 at 03:52 AM.
I did rollback xfce-session to another previous version and it now works, so I suspect xfce-session-logout has some unknown issue. I'm working with xfce-session-4.10.0 and the problems seems to have vanished.
I did rollback xfce-session to another previous version and it now works, so I suspect xfce-session-logout has some unknown issue. I'm working with xfce-session-4.10.0 and the problems seems to have vanished.
I can't help verify that cos I didn't install xfce-session
I can confirm a similar problem on Alpine Linux (non Systemd OpenRC based distro w/ XFCE). XFCE works great, but when I compiled MATE and GTK I was running into some sort of startx / xinit problem.
Hey Keith... I will check ASAP in the virtual machine. No information for the moment as to whether my problems are linked, and whether you're workaround solves the issue on Alpine Linux.
For anyone using Alpine there is actually a Mate package in testing repo so you don't have to necessarily do it yourself like I did. Again, Alpine is a secure (grsec patched ) kernel distro that uses Gentoo's OpenRC and eudev. Alpine also ditches glibc in favor of musl. The guys who created Alpine have no plans to migrate to systemd, and are actively building around it for the future.
Alpine is a bit like LFS crossed with slackware. It has it's own toolchain etc , OpenRC, supports xfce out of the box.
Look good? Now we detect if systemd is running if not resume with the default behavior.
Code:
--- startx.orig 2015-04-30 12:12:21.711606325 -0400
+++ startx 2015-04-30 12:59:45.497304617 -0400
@@ -101,6 +101,10 @@
server=$defaultserver
+# Detect if we are using systemd or not
+usingsystemd="$(type systemd | sed -e 's/systemd is //g')"
+if [ -f $usingsystemd ]
+ then
# 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"
@@ -109,7 +113,9 @@
tty_num=$(echo "$tty" | grep -oE '[0-9]+$')
vtarg="vt$tty_num"
fi
-
+ else
+ echo "No systemd found"
+fi
# For compatibility reasons, only use xserverrc if there were no server command line arguments
if [ x"$serverargs" = x -a x"$display" = x ]; then
Last edited by /dev/random; 04-30-2015 at 12:40 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.