I started answering this (as I do when I start answering a lot of questions on AU) because I wanted to know more. You've asked some pretty decent questions about how things work that I confess, I didn't immediately have answers to. I've done my best.
You'll understand what I'm talking about when you look at man xorg.conf
and find things like this:
VIDEOADAPTOR SECTION
Nobody wants to say how this works. Maybe nobody knows ...
Seriously.
LightDM is started by Upstart (the init
system, started by the Kernel on boot) here:
/etc/init/lightdm.conf
That feeds into the lightdm
command which reads (seat information, etc) from:
/etc/lightdm/lightdm.conf
/etc/lightdm/lightdm.conf.d/*
And then starts X which looks for the following configurations:
/etc/X11/<cmdline>
/usr/etc/X11/<cmdline>
/etc/X11/$XORGCONFIG
/usr/etc/X11/$XORGCONFIG
/etc/X11/xorg.conf
/etc/xorg.conf
/usr/etc/X11/xorg.conf.<hostname>
/usr/etc/X11/xorg.conf
/usr/lib/X11/xorg.conf.<hostname>
/usr/lib/X11/xorg.conf
/etc/X11/xorg.conf.d/*
/usr/etc/X11/xorg.conf.d/*
If present in the configuration, that's how X would pick the driver/monitor/etc layout... If it's not, the newer XRandR extensions have a major part to play in guessing and persisting monitor settings.
If you don't want a best guess, you can force it in a direction by:
But if you let xrandr
handle things, once you log in, the configuration comes from:
~/.config/monitors.xml
After X starts there's a load of session gubbins (autostarts, etc) that start that aren't particularly relevant to the graphics process but they're probably worth mentioning. Mentioned.
There are two bits that elude proper explanation:
- The relationship between Xorg and Kernel drivers has made me go thoroughly cross-eyed. I found a very exhausti{ve,ng} book on the subject[PDF!] but haven't had the time to even scratch it.
- How Xorg/XRandr picks the right driver.
There's certainly a lot more automagical wrangling than there used to be.
It is possible that the folder /var/lib/lightdm
has not been created.
You could try: mkdir -p /var/lib/lightdm; chown -R lightdm:lightdm /var/lib/lightdm ; chmod 0750 /var/lib/lightdm
with root permission if needed.
Best Answer
/etc/init.d/lightdm starts the Xserver. Lightdm gets started first then it starts the Xserver. The parent process of the Xserver (Xorg) is lightdm (PID 25600 as shown in example below). You can see this by executing:
Running the following commands will stop and start lightdm and Xserver accordingly: