Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 May 2020 04:14:58 +0000
From:      Brandon helsley <brandon.helsley@hotmail.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Xdm
Message-ID:  <CY4PR19MB16551A2AE7769B03B8773D8AF9AB0@CY4PR19MB1655.namprd19.prod.outlook.com>
In-Reply-To: <20200501055947.895016a6.freebsd@edvax.de>
References:  <CY4PR19MB1655C8835F43E4D7304D5DD5F9AA0@CY4PR19MB1655.namprd19.prod.outlook.com> <20200501050648.f5a0ab6a.freebsd@edvax.de> <CY4PR19MB16554D1EC7DBB535515277F2F9AB0@CY4PR19MB1655.namprd19.prod.outlook.com>, <20200501055947.895016a6.freebsd@edvax.de>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Has anybody else had any problems logging in with xdm?

Sent from Outlook Mobile<https://aka.ms/blhgte>;

________________________________
From: Polytropon <freebsd@edvax.de>
Sent: Thursday, April 30, 2020 9:59:47 PM
To: Brandon helsley <brandon.helsley@hotmail.com>
Cc: freebsd-questions@freebsd.org <freebsd-questions@freebsd.org>
Subject: Re: Xdm

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;
same.

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:

        #!/bin/csh
        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

Deviation:

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
approach".

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.

Correct.



> 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:

        #!/bin/csh

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
~/.xinitrc.

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

        .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.





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



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?CY4PR19MB16551A2AE7769B03B8773D8AF9AB0>