Polytropon freebsd at edvax.de
Fri May 1 03:59:53 UTC 2020

Re-including list, hope that's okay; use your "reply all"
function or at least reply to the mailing list. :-)

On Fri, 1 May 2020 03:29:23 +0000, Brandon helsley wrote:
> I don't understand your instructions for xsession entries.
> My apologies for wasting you typing. Please continue to help
> I'm receptive.

THose are files located in your home directory, usually
/home/<username>, abbreviated with the ~ synbol. Those
files start with a . ("hidden files") and are read during
the X startup process.

When you're using "startx" to start your X session, .xinitrc
will be read.

When you use xdm, after successful login it will use .xsession
and ignore .xinitrc.

	.xinitrc	--->	startx

	.xsession	--->	xdm

The idea to be more flexible, and have your X configuration
in only one file, is to use a "cascading approach": If xdm
is used, it reads .xsession, which "continues" as .xinitrc;
all done. If you use "startx", only .xinitrc will be used;

The _content_ of .xinitrc depends on what desktop environment
you have installed, or which window manager you wish to use.
In my case (and therefore the example), it's WindowMaker, plus
a few custom additions. For testing, you should be fine
using a simple "exec xterm" file.

So start by creating the following files:

First, ~/.xsession:

	source ~/.cshrc
	exec ~/.xinitrc

I assume you're using FreeBSD's default login shell for dialog
users, which is the C shell; if you're using bash or zsh or
ksh, you need to change those entries accordingly.

Then, ~/.xinitrc:

	exec xterm


If you do _not_ need this flexibility, ignore .xinitrc entirely,
and just for testing, have

	exec xterm

in your ~/.xsession file. But as you said (later on) you
already have a .xinitrc file, let's go with the "cascading

This should be enough for first testing, i. e., to see if the
login process works as intended. If it's successful, you will
see an X terminal, nothing else, no window decorations, but
that is not needed for testing. Enter "exit" or press Ctrl+d
to exit the terminal - now the xdm login screen should appear
again. Do _not_ test this with "root", as I mentioned, only
with your user name.

Now, if you see that xterm, you can manually enter "fluxbox"
for further testing. Note that Fluxbox's logout function will
not work as desired - it will quit Fluxbox, but you need to
close the X terminal to end the X session (because that is
the "controlling process" that keeps X alive).

On Fri, 1 May 2020 03:28:15 +0000, Brandon helsley wrote:
> I meant ttyv8 like you said.


> I have xinitrc with fluxbox exec in it.

Excellent! This should be fully okay (probably "exec fluxbox",
maybe something before that). But as I said, xdm will not
care for .xinitrc. THat is the reason for the "cascading
approach". I'm using xdm here, but I have my configuration
in .xinitrc.

THat's why .xsession does the following:


The first line tells the interpreter and the reader that
this file is to be processed using the C shell.

	source ~/.cshrc

The second line will source my shell configuration from the
C shell's initialisation file for interactive shells.

	exec ~/.xinitrc

The third line will continue execution under the name of

>From the viewpoint of xdm, the execution control is now as

	.xsession -> .xinitrc -> window manager

So if the window manager (or desktop environment) exits, the
X session will be closed - exactly as desired.

> What do I do with xdm to make it work?

Well, xdm will read .xsession if it is present. I'm not sure
if it's still required to make it executable (could be some
"cargo cult"), but in worst case, try:

	% chmod +x ~/.xsession

The permissions should then be -rwxr-xr-x. Verify with "ls -l".

> I'm confused about your instructions, do I put in a line
> for xdm anywhere

Not needed. If you have the /etc/ttys entry, and you see the
xdm login screen, everything is fine. You just have to make
sure that ~/.xsession "contains the truth", i. e. possible
path names are correct, and Fluxbox is installed.

Also see the file ~/.xsession-errors for a possible message.

On Fri, 1 May 2020 03:29:23 +0000, Brandon helsley wrote:
> I don't understand your instructions for xsession entries.
> My apologies for wasting you typing. Please continue to help
> I'm receptive

This is only needed if you wanted to be able to use both xdm
and "startx" (can be useful for experimental and learning
systems). If you know you will only be using xdm, it's not
needed. Ignore .xinitrc, and have .xsession just contain the
programs you need for your X session, typically ending in
"exec <name>" for your window manager or desktop environment.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list