startup file?

Glynn Clements glynn at gclements.plus.com
Thu Mar 16 06:53:23 PST 2006


Igor Kolar wrote:

> I need the name of the startup file that's run after I log into x.org.

You don't "log in" to "x.org".

The X server doesn't have a startup script. Startup files are
implemented by the program used to start the X server (e.g. startx,
xinit, xdm, gdm, kdm).

Those programs can be configured (each in its own way) as to which
script(s) they run. OS distribution vendors frequently customise the
configuration of those programs for their specific distribution, so
the details may vary between distributions.

Whilst people might be able to identify some common locations, the
only reliable answer can be found by examining the configuration
file(s) for the program in question. However, the scripts which are
specified in the xdm/gdm/etc configuration files are normally only the
first step in a chain of chain of system-wide and per-user startup
scripts, so you will also have to read the scripts themselves.

E.g. the xdm configuration file is usually either
/etc/X11/xdm/xdm-config or /usr/X11R6/lib/X11/xdm/xdm-config (the
latter is the historical location; most newer systems use the former). 

On my system (Gentoo), xdm-config specifies /etc/X11/xdm/Xsession as
the startup script, which first runs /etc/X11/chooser.sh with
~/.xsession as a fall-back.

chooser.sh tries to get the value of $XSESSION from either the
environment or from /etc/conf.d/basic or /etc/rc.conf. If $XSESSION is
set, and the file /etc/X11/Sessions/$XSESSION exists, that is used. 
Otherwise if $GENTOO_SESSION is set and is the name of an existing
file, that is used. Otherwise, it runs twm.

In my case, $XSESSION is set to Xsession, so the script
/etc/X11/Sessions/Xsession is run. That script is just as complex as
chooser.sh, but ultimately it ends up running ~/.xsession.

But, as I said, that's on my system, using xdm. Yours is probably
different.

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list