I'm having problems with my
Xserver sometimes failing to start. It doesn't happen consistently, but when it happens, instead of showing the login screen I get
some vague one-line error message about some service failing to start (can't remember exactly what it says now, and it's not copy-pasteable...) the following error message:
** (plymouthd:313): WARNING **: Command line `dbus-launch --autolaunch=56a6ab7418a994dcd756ff100000002 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
For those of you too lazy to scroll: the line ends with
Autolaunch error: X11 initialization failed.
The only way to get anything done is to Ctrl+Alt+Fx to one of they TTY terminals, which after login proceeds to tell me (
once or more twice) that I
Failed to connect to X Server, and refer to
/var/log/Xorg.0.log for details.
When this happened just now,
grep /var/log/Xorg.0.log -e EE gave me this:
(WW) warning, (EE) error, (NI) not implemented, (??) unknown. [ 3.936] Initializing built-in extension MIT-SCREEN-SAVER [ 3.998] (EE) intel(0): [drm] Failed to open DRM device for pci:0000:00:02.0: No such file or directory [ 3.998] (EE) intel(0): Failed to become DRM master. [ 3.998] (EE) Screen(s) found, but none have a usable configuration. [ 3.998] (EE) [ 3.998] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. [ 3.998] (EE)
I login, and reboot. Usually one reboot is enough to get it working, but sometimes it takes two or three.
I beleive this is caused by some service not terminating properly when Ubuntu quits on system shut down, and - since I have had other problems with it as well - I wouldn't be surprised if it's related to my graphics cards (I have a laptop with an NVidia G550M and an Intel integrated card), but I have no idea where to go from here.
How do I figure out exactly what caused the problem? Is it likely to be a bug somewhere, or is it due to an error of mine?
As suggested in the linked-to bug report I tried restarting
lightdm from the TTY terminal, and that got me a login working login screen. The bug report talks about this behavior being caused by a race condition at startup, so that not all required devices are available when
lightdm starts (see e.g. comments #23 and #48). Most of them involve changing
/etc/init/lightdm.conf in some way as to either prevent the race condition by stalling (e.g.
sleep 2), or respawn if the first attempt crashes (and hope the second attempt is delayed enough to succeed). Is a workaround like that "update safe", or will it be overwritten when
lightdm is updated? Is there a better way to work around (or even fix) this?