LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-05-2019, 10:16 AM   #1
jrch
Member
 
Registered: Mar 2006
Posts: 158

Rep: Reputation: 15
Moved Topic - 'startx' continual (for years) intermittent failure


This topic was moved from 'Slackware-Installation' to the 'main' Slackware forum in hopes of wider response. I'm sorry if that irritates some folks, but I consider it necessary.

For several years now, and on at least six different computers running Slackware of various versions (usually with xfce), I have experienced intermittent failure of the 'startx' command on cold boot into a user account. Currently this happens on three different computers with Slackware64 14.2 with multilib and xfce4. Typically, startx fails on first and/or second call, then usually succeeds by third trial.

When startx fails, it always results in black screen for 2-3 seconds, then returns to user prompt ($), with (consistent) message like,

" ...
...
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Dec 2 13:47:31 2019
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
resize called 1920 1080
/usr/bin/startxfce4: X server already running on display :0
_IceTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_IceTransMakeAllCOTSServerListeners: server already running
xfce4-session: Unable to establish ICE listeners: Cannot establish any listening sockets
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file."

Every time it fails, it includes the 'claim' that the 'X server is already running on display :0", which seems false, as it happens also on cold boots.

I've looked thru the log file without success in finding a 'culprit', probably due to my own lack of knowing what to look for. The log file typically consists of many 'trials' for 'missing screen section', trial modelines, etc etc. When successful, the logfile just ends with a last line like,

"...NOUVEAU(0): Modeline "1280x800"x0.0 1280 1328 ... " etc,
with no lines following.

I read that 'NOUVEAU' is x's name for an emulation of NVIDIA, which board seems to be in all my machines. I have not tried 'new drivers' and I have doubts that they would solve this.

My monitor resolutions are all 1920x1080.

Hazel commented that maybe (1) I was entering a runlevel other than '3'. Checking, I find this not to be the case, both in the boot messages or in /etc/inittab. - or, (2) If X is running should be able to find it with (probably) alt-F7. I've tried that when returned to the boot line, both 'Alt-F7' and 'Ctrl-Alt-F7'. No response.

I have checked for the existence of a '.X0-lock' file (or similar) - no file like that exists until X boots successfully.

I looked on the x webpage (www.x.org) at the Faq, especially one question that duplicates the 'already running' message. None of the remedial actions suggested there have any positive effect. There is no 'lock file' at all until X is started.

One other person (not slackware forum) suggested booting x with 'startxfce4'. This 'works', but leaves some menu items in xfce disabled. So is not satisfactory.

Given that this has been going on for years, I'm a bit frustrated. I don't find very much discussion of this problem here or elsewhere online. This seems strange, since it seems 'built-in' to this household, and has for several years of Slackware use. My slackware installs are always from the DVD (earlier CD's) - by the book. I've not upgraded a kernel - but this happened long before that was relevant.

If anyone has experience with this problem and found a resolution, I would be very interested to hear about it.

Thanks - jrc
 
Old 12-05-2019, 10:52 AM   #2
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
I confirm the behavior.

In my case the problem started about a month ago and only on my Lenovo T400 laptop. On my office system I never experience the issue. I am using 14.2 and Xfce. Both systems use the i915 video driver.

My solution thus far with the laptop is to wait a few seconds after the login prompt appears. Somewhat a "let the dust settle" approach. I won't say my waiting resolves the problem as this is an n=1 occurrence and I have not tried to dig deeper.

I have the haveged daemon running from rc.M so unlikely to be some kind of entropy issue.

I thought I had done something peculiar to cause the behavior. Now that you report something similar I am curious about a possible common root cause.

Last edited by upnort; 12-05-2019 at 10:54 AM.
 
Old 12-05-2019, 12:16 PM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
I've seen this dbus-launch chaining in .xinitrc cause problems before:
Code:
########################################################################
##  Start xfce Desktop Environment                                    ##
########################################################################

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session dbus-launch --exit-with-session /usr/bin/startxfce4
else
  exec dbus-launch --exit-with-session /usr/bin/startxfce4
fi
As startxfce4 will start dbus using the -- IMO more reliable -- eval `dbus-launch` method, the above is unnecessarily complicating things. I'd simplify it to:
Code:
########################################################################
##  Start xfce Desktop Environment                                    ##
########################################################################

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session /usr/bin/startxfce4
else
  exec /usr/bin/startxfce4
fi
Even if it doesn't solve your issue, you'll have made the startup environment a little cleaner.

Last edited by GazL; 12-05-2019 at 01:42 PM.
 
Old 12-05-2019, 01:10 PM   #4
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
I've changed my xinitrc files. We'll see how that goes, although in my use case I don't always see the problem on the laptop.
 
Old 12-05-2019, 01:25 PM   #5
magicm
Member
 
Registered: May 2003
Distribution: Slackware
Posts: 237

Rep: Reputation: 152Reputation: 152
I've also changed my .xinitrc per GazL's suggestion (although, I think there's a typo there, as the $DESKTOP_SESSION test didn't seem complete - I ignored that). But also, this has been intermittent for a _long_ time. I've never been bothered enough to look into it, because a second invocation of startx alsways succeeded.
 
1 members found this post helpful.
Old 12-05-2019, 01:41 PM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Oops, cut and paste error, Ill go back and fix it. Sorry about that.
 
Old 12-05-2019, 02:13 PM   #7
hitest
Guru
 
Registered: Mar 2004
Location: Canada
Distribution: Void, Debian, Slackware
Posts: 7,342

Rep: Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746
Quote:
Originally Posted by upnort View Post
I confirm the behavior.
I have this behavior intermittently on one of my Slackware units.
 
Old 12-05-2019, 02:29 PM   #8
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by jrch View Post
"
/usr/bin/startxfce4: X server already running on display :0
_IceTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_IceTransMakeAllCOTSServerListeners: server already running
xfce4-session: Unable to establish ICE listeners: Cannot establish any listening sockets
xinit: connection to X server lost
"

Every time it fails, it includes the 'claim' that the 'X server is already running on display :0", which seems false, as it happens also on cold boots.
I haven't experienced this issue and have little/no knowledge about this but that doesn't stop me from making a wild guess...

I notice that a socket exists in /tmp/.ICE-unix. Could the permissions and/or persistence of that directory/socket in /tmp cause the problem, even on a cold boot?
 
Old 12-05-2019, 03:23 PM   #9
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Quote:
I notice that a socket exists in /tmp/.ICE-unix
I configure /tmp to tmpfs, so on my system the socket file is always deleted on reboot/halt. Yet I intermittently see the reported problem on my laptop. Perhaps the OP might want to look at that -- boot to init 1 and delete everything in /tmp if not using tmpfs.

Last edited by upnort; 12-05-2019 at 03:24 PM.
 
Old 12-05-2019, 10:05 PM   #10
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Hello Upnort, Jrch, and Hitest

Could you upload the x error log?

Regards,
Ozan
 
Old 12-05-2019, 10:10 PM   #11
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I must be lucky.

I've not encountered this.
 
Old 12-06-2019, 05:44 AM   #12
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by GazL View Post
I've seen this dbus-launch chaining in .xinitrc cause problems before:
Code:
########################################################################
##  Start xfce Desktop Environment                                    ##
########################################################################

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session dbus-launch --exit-with-session /usr/bin/startxfce4
else
  exec dbus-launch --exit-with-session /usr/bin/startxfce4
fi
As startxfce4 will start dbus using the -- IMO more reliable -- eval `dbus-launch` method, the above is unnecessarily complicating things. I'd simplify it to:
Code:
########################################################################
##  Start xfce Desktop Environment                                    ##
########################################################################

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session /usr/bin/startxfce4
else
  exec /usr/bin/startxfce4
fi
Even if it doesn't solve your issue, you'll have made the startup environment a little cleaner.
Actually during the early stages of Plasma5 I had to explicitly add "dbus-launch --exit-with-session" in order to fix the progress bar in the splash screen: https://git.slackware.nl/ktown/commi...33dded7eefab8b
Never tested whether it is still required.
 
Old 12-06-2019, 06:44 AM   #13
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Does startkde not contain an eval `dbus-launch -sh-syntax`? I'd look myself but I don't install the KDE sets.


As I remember it, the issue is that to run properly the dbus-launch has to be run within the console-kit session, but when you exec chain them like that whatever you pass to dbus-launch to be exec'd doesn't get a completely clean process environment to run in.

This caused a problem for me a few years ago when X noticed that the window manager trying to connect had the same PID as an existing X11 connection because dbus-launch had exec'd it without forking and that specific window manager didn't fork itself into the background on startup either, so they both had the same PID. The result was that the X connection from the window-manager was refused.

I find that using the 'eval' method instead of chaining the launch commands avoids these sorts of complications. So, now I always have it set up like this:

xinitrc runs ck-launch-session /usr/bin/somescript
/usr/bin/somescript does eval `dbus-launch --sh-syntax --exit-with-session` (if the DE startup doesn't do it itself) and then exec's the window-manager/DE.

I'll attach my generic window manager starting script as an example in case anyone is interested.

Last edited by GazL; 05-02-2020 at 08:26 AM.
 
Old 12-06-2019, 10:30 AM   #14
jrch
Member
 
Registered: Mar 2006
Posts: 158

Original Poster
Rep: Reputation: 15
Thanx for comments

I appreciate just knowing that others have the problem. I guess knowing that one can eventually get x going by repeating 'startx' makes it of lower priority - it did for me.
Trying to attach 'startxfail-log-jrch.txt' here..
jrc
Attached Files
File Type: txt startxfail-log-jrch.txt (32.0 KB, 22 views)
 
Old 12-07-2019, 05:48 PM   #15
jrch
Member
 
Registered: Mar 2006
Posts: 158

Original Poster
Rep: Reputation: 15
Trying the modified .xinitrc ...

Saturday evening,

I'm trying the .xinitrc modified as per Gazl; so far on two computers, 2 or 3 cold boots startx works flawlessly. Not a conclusive test yet, will report as more trials done.

Thanks for everyone's comments.

jrc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Puzzles & Jokes (Off-Topic Topic) w1k0 Slackware 66 05-03-2013 05:18 PM
topic : no topic Timbo General 14 03-27-2003 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration