From: chris@ods.com (Chris Atkins)
Newsgroups: fj.mail-lists.x-window
Subject: Re: HELP xdm setup on single sun.
Date: 23 Jul 92 14:43:57 GMT
Distribution: fj
Organization: Optical Data Systems, Inc.

Date: 22 Jul 1992 19:47:15 GMT
Message-Id: <1992Jul22.194715.17413@ods.com>
Newsgroups: comp.windows.x

djones@mltsa.UUCP writes:
: Hi, This must have been asked about a million times !
: I am trying to get xdm (X11R5) running on a SUN(ipx). Simply to control
: the 'local' display. I have two questions.
: 
: (1) I followed the example given in the man page and the
: greeting I get keeps talking of "unsecure session". What
: do I need to do to make it "secure" ?
: 
Based on the xdm man page from O'Reilly Volume 3, the "unsecure session" 
message is there because the configuration file requests X authorization but
there is no authorization in use when the greeting is brought up.  You have 
2 choices to get rid of this, 
1) set DisplayManager*authorize: false
   This turns off authorization.
2) Set up to use authorization.  I can't help you out much with this one.  You
   might try setting up an outhorization file for the server.

: (2) What is the "best" way to start xdm. I added a line at the
: end of rc.local to fire it up, viz xdm -config /blah../lib/X11/xdm/xdm-config
: Is there a "better" way ?
: 
To start up xdm add the following to the end of your rc.local:
if [ -f /usr2/X11/bin/X11/xdm ]; then
        /usr2/X11/bin/X11/xdm -daemon -config /xdm/xdm-config
fi

If you wish to start up different window environments (ie. motif, ow2, ow3) at
login time, you can add the following translations to the Xresources file.
        Ctrl<Key>F1:    set-session-argument(failsafe) finish-field() \n\
        <Key>F1:        set-session-argument(x) finish-field() \n\
        <Key>F2:        set-session-argument(ow2) finish-field() \n\
        <Key>F3:        set-session-argument(ow3) finish-field() \n\
        <Key>Return:    set-session-argument() finish-field()
the argument to set-session-argument is passed to the Xsession file.

One thing I found out was that it was difficult to get setup to be able to
use both xterm and any of sun's shell type tools(shell tool, cmd tool, etc.)
To overcome this problem, I did the following:
I added the following line to the default Xsession script:
stty echoe echoctl echoke

In my ~/.xsession file I put the following:
/usr2/X11/bin/X11/xterm -geometry 80x24+10+200 -sb -iconic -name Xsession -l -lf
 "$HOME/Xlog" -xrm "Xsession*sensitive: False" -e $HOME/.xsession-nodeamon $1

$1 is passed in from the set-session-argument above.

The $HOME/.xsession-nodeamon script looks like this:
#!/bin/csh
# this is the program that is run as the client
# for the display manager.
#
source $HOME/.cshrc
setenv WINSYS $1
source $HOME/.login
source $HOME/.xinitrc

The variable WINSYS is passed to my .login script and I use it to setup my
path, and load library path based on whether I am running motif, ow2 or ow3.  I
also determine the window manager to start and pass that to .xinitrc via an
environment variable.

I am not sure why I had to create a dummy xterm and then do my .xinitrc script
from it to get both the sun tools and xterm to work, but it does work.

Good luck,
Chris Atkins
chris@ods.com