Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've built the entire Xserver from git for testing proposes using the build.sh provided by freedesktop.org as the easier method to compile all modules against the git tree, and installed under the /opt/xorg path. The problem is that I can't find how gdm decides from where to load the Xserver and related binaries.

I've read on the X.org site the section: 'Actually running the conformance tests', but the scripts/helpers that I could use returns a 404.

Although I know where the Xorg executable is and its links, I'm not sure that will be enough to make everything work as expected, as I want to test the Xserver built and installed in the custom path.

I'm using Debian 7.0 and GDM 3.4.1.

Any other method could be used too?

share|improve this question
    
Please provide the output for pstree on your running X11. Very early in that tree your will see a X11-login-manager. I do not know how this looks like on Debian 7. –  Nils Jul 22 '13 at 8:57

3 Answers 3

up vote 4 down vote accepted
+50

Answer in 2 words: The location of Xserver for GDM is hard-coded at compile time in configure.ac, line 1199 in X_SERVER variable and can't be configured. So, may be you could play with symlinks, linking /usr/bin/Xorg (or, less probably /usr/bin/X, see this) to your build of Xserver.

Details:

I have a Debian 7, too and here's my process tree:

 |-gdm3-+-gdm-simple-slav-+-Xorg
 |      |                 |-gdm-session-wor-+-gnome-session-+-bluetooth-apple---{bluetooth-apple}
 |      |                 |                 |               |-evolution-alarm---2*[{evolution-alarm}]
 |      |                 |                 |               |-gdu-notificatio
 |      |                 |                 |               |-gnome-fallback----2*[{gnome-fallback-}]
 |      |                 |                 |               |-gnome-panel-+-gnome-terminal-+-bash
 |      |                 |                 |               |             |                |-bash---vi
 |      |                 |                 |               |             |                |-bash-+-less
 |      |                 |                 |               |             |                |      `-pstree
 |      |                 |                 |               |             |                |-gnome-pty-helpe
 |      |                 |                 |               |             |                `-3*[{gnome-terminal}]
 |      |                 |                 |               |             |-iceweasel-+-plugin-containe-+-4*[gtk-gnash]
 |      |                 |                 |               |             |           |                 `-{plugin-containe}
 |      |                 |                 |               |             |           `-31*[{iceweasel}]
 |      |                 |                 |               |             |-pidgin
 |      |                 |                 |               |             `-3*[{gnome-panel}]
 |      |                 |                 |               |-gnome-screensav---2*[{gnome-screensav}]
 |      |                 |                 |               |-gnome-settings----2*[{gnome-settings-}]
 |      |                 |                 |               |-gnome-sound-app---{gnome-sound-app}
 |      |                 |                 |               |-metacity---3*[{metacity}]
 |      |                 |                 |               |-nm-applet---{nm-applet}
 |      |                 |                 |               |-notification-da---{notification-da}
 |      |                 |                 |               |-polkit-gnome-au---{polkit-gnome-au}
 |      |                 |                 |               |-ssh-agent
 |      |                 |                 |               |-tracker-miner-f---2*[{tracker-miner-f}]
 |      |                 |                 |               |-tracker-store---6*[{tracker-store}]
 |      |                 |                 |               `-3*[{gnome-session}]
 |      |                 |                 `-2*[{gdm-session-wor}]
 |      |                 `-{gdm-simple-slav}
 |      `-{gdm3}

So, Xorg is started via gdm-simple-slave. Definitly, /etc/gdm/Init/Default has nothing to do with starting Xserver, as it was said here and here.

There were some indications, that it's impossible to configure, how X is started from gdm.

I decided to go for source codes, which are pretty well structured. So:

Go to the source codes, there is a daemon folder, which contains an INTERNALS file, explaining the structure of code.

There you can read:

** GdmServer

A class, used by the slave, that manages running a local X Server.

So, the file we need is https://git.gnome.org/browse/gdm/tree/daemon/gdm-server.c

There are several nested functions, responsible for calling X server and creating its command line arguments.

The function directly responsible for running X server process is gdm_server_spawn, which spawns the X in the line 694 with glib's g_spawn_async_with_pipes.

So, we're to find out, how its argv is formed. Well, in 2 words it's line 293 and we need the value of X_SERVER macro (unless you're using RedHat's systemd instead of sysVinit, but you aren't :)).

Alas, this macro is seemingly formed in configure.ac, line 1199 and is hard-coded. So, it seems that the best option is to place a symlink to your build of Xserver to one of those locations.

share|improve this answer
    
Seems that I can rebuild the package too and install my own gdm3 broke version :D, no? I'll start now. –  Braiam Jul 22 '13 at 12:15
    
@Braiam Sure, that's a solution, too. Besides, if you found out anything about Gdm integration with Gnome, could you let me know? :) Cause all the documentation on that point is outdated and refers to gconf, while nowadays gdm3 seems to use dconf and no manual on the new dconf layout of /usr/share/gdm is available in docs: help.gnome.org/admin/gdm/3.8/configuration.html.en. –  Bob Jul 22 '13 at 12:28
    
What happens on RedHat? –  Nils Jul 22 '13 at 21:15
    
@Nils It just uses another macro, SYSTEMD_X_SERVER in the server call git.gnome.org/browse/gdm/tree/daemon/gdm-server.c#n287 and in configure.ac: git.gnome.org/browse/gdm/tree/configure.ac#n931 to start "systemd-multi-seat-x" "X server wrapper". About multiseat: freedesktop.org/wiki/Software/systemd/multiseat and its support: mail.gnome.org/archives/commits-list/2012-February/…. –  Bob Jul 22 '13 at 23:12
    
You did hit the mark, and did not at the same time. GDM3 tries to start Xorg from my personalized path but fails miserably without any error. I've created a diff file that contains the changes to be made to the source (only 2 files, or in case of debian sources, 1) for the people interested. X_PATH, X_SERVER_PATH and X_SERVER are the variable to search for. @Bob you might like to look at /etc/gdm3/PreSession/Default and /etc/gdm3/Init/Default as they contain some hints of configuration available. –  Braiam Jul 25 '13 at 6:27

Since @Bob says there's no runtime configuration option for this and I didn't want to rebuild gdm3 from patched source, I took the following approach.

First, move the real X server aside:

sudo dpkg-divert --local --rename --add /usr/bin/Xorg

Then drop a new shell script in place of /usr/bin/Xorg:

#!/bin/sh
test -x /usr/local/bin/Xorg && exec /usr/local/bin/Xorg
exec /usr/bin/Xorg.distrib

This script will run Xorg from /usr/local if there's a version there, or fall back to the Debian-packaged version that we dpkg-diverted in the first step otherwise.

This way you can easily rollback to a known-good version by removing or renaming your custom-built Xorg binary; I do that using GNU Stow.

share|improve this answer

I just looked this up on my CentOS 5 which uses gdm 2.16.0.

There I found this configuration-file: /etc/gdm/Init/Default.

To me it looks like the right place to insert a different X11.

share|improve this answer
    
GDM 2 isn't GDM3 :/, also cat: /etc/gdm/Init/Default: No such file or directory –  Braiam Jul 22 '13 at 12:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.