SUMMARY-xdm & openwindows

From: David Robson (dave@lpdwhy.bhp.com.au)
Date: Mon Oct 17 1994 - 14:18:39 CDT


Thanks to all who responded! I haven't had a chance to try this stuff yet,
but it looks good. My concern is that the save workspace feature won't
work any more.
I have included a summary about starting xdm, which is relevant.

My original post:

I have xdm running on a couple of Solaris 2.3 systems. At the moment I'm
still trying to live with Openwindows :-(

Now when users log in they don't get their usual "deskset" such as
cmdtool and filemanager. You can run these, but saving your workspace
doesn't work.

Any fix for this?

> Does anyone out there know how to get xdm running on Solaris 2.3?
> I've tried several experiments and tried to RTFM, but I can't seem
> to get it to work.

Thanks to the following people who responded:

Andrej.Misik@fmph.uniba.sk
richm@netcom.com (Richard Mauri)
Geoff Mellor <grm@star.le.ac.uk>
Johnny.Hui@artecon.com (Johnny Hui)
dave@lpdwhy.bhp.com.au (David Robson)
everling@iis.fhg.de (Dirk Everling)
lab@Access.COM (Larry Blom)
poc@usb.ve (Patrick O'Callaghan)

Several people sent me the xdm FAQ which was very helpful. Getting xdm to
run on Solaris 2.3 worked pretty much as stated in the FAQ. The main
problem I had was that it would not use my .xinitrc file because it happened
to not be executable. Without xdm, .xinitrc apparently only needed to be
readable.

Here are the steps I did to get xdm running:

1. Remove the last line from /etc/inittab:

co:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` console login: " -T sun -d /dev/console -l console -m ldterm,ttcompat

   (This step was not explicitly mentioned in the FAQ)

2. Create a start/stop script for xdm and put it in to /etc/init.d. The
   one I created was basically the one given in the xdm.faq.

-------------------------- script ------------------------------------
#!/bin/sh
#
# xdm-setup

OPENWINHOME=/usr/openwin; export OPENWINHOME
LD_LIBRARY_PATH=$OPENWINHOME/lib; export LD_LIBRARY_PATH

XDM_PID=`cat /var/tmp/xdm-pid 2>/dev/null`

xdm_running () {
  ps -p $XDM_PID > /dev/null 2>&1
}

case "$1" in
start)
  if xdm_running; then
    echo "xdm is already running" >&2
  else
    echo "starting xdm" >&2
    $OPENWINHOME/bin/xdm -config $OPENWINHOME/lib/xdm/xdm-config
  fi
  ;;

stop)
  if xdm_running; then
    echo "stopping xdm" >&2
    kill $XDM_PID
  else
    echo "xdm is not running" >&2
  fi
  ;;

*)
  echo "Usage: /etc/init.d/xdm-setup { start | stop }" >&2
  ;;
esac
-------------------------- end script ---------------------------------

3. In /etc/rc3.d:

           ln /etc/init.d/xdm-setup S99xdm
           ln /etc/init.d/xdm-setup K99xdm

then reboot.

4. Make sure .xinitrc is executable. You may have to copy the file
   $OPENWINHOME/lib/Xinitrc into your home directory as .xinitrc
   or modify the file $OPENWINHOME/lib/xdm/Xsession to force xdm
   to use $OPENWINHOME/lib/Xinitrc as its startup file.

==============================================
Robert Kline
Computer Science Department
West Chester University
West Chester, PA 19383
Phone: 610-436-2181
e-mail: rkline@wcupa.edu
==============================================

Hi David,

To better integrate the XDM login method with Openwindows environments, one of
our Field Engineers came up with the following Xsession file (replaces
/usr/openwin/lib/xdm/Xsession). This Xsession file handles starting
applications that a user has listed in their .openwin-init file which is what
basically constitutes the "deskset".

Hope it proves useful.

-- 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Kris Olander
-	NCD Field SE, N. Cal. District
-	support@ncd.com -and/or- kriso@ncd.com
----------------------------------------------

--PART-BOUNDARY=.19410121141.ZM8977.ncd.com Encoding: 191 text X-Zm-Content-Name: OW.help.new Content-Type: text/plain ; charset=us-ascii

#!/bin/sh # ########################################################################## # # ********* Xsession ********* # # This is the program that is run as the client for the display # manager. This example is quite friendly as it attempts to # run a per-user $HOME/.xsession file instead of forcing a particular # session layout. # # If a user does not have a $HOME/.xsession file, then it starts # OpenWindows as the default environment. # # It works equally well with OpenWindows V2 or V3. # ##########################################################################

# Redirect client errors to user's HOME directory

exec > $HOME/.xdm-errors 2>&1

########################################################################## # Set Application & Global environment variables here

NCDNAME=`echo $DISPLAY | sed 's/:.*//'` export NCDNAME

##########################################################################

if [ -f $HOME/.xsession ]; then if [ -x $HOME/.xsession ]; then exec $HOME/.xsession else exec /bin/sh $HOME/.xsession fi else

################################################################## # # Start OpenWindows since the user does not have a $HOME/.xsession # execution script. # ##################################################################

# OpenWindows Global environment variables

OPENWINHOME=/usr/openwin PATH=$OPENWINHOME/bin:$OPENWINHOME/bin/xview:$OPENWINHOME/demo:$PATH LD_LIBRARY_PATH=$OPENWINHOME/lib:/usr/lib MANPATH=$OPENWINHOME/share/man:/usr/man HELPPATH=$OPENWINHOME/lib/help:$HELPPATH LOGNAME=$USER TERM=vt100

export OPENWINHOME LD_LIBRARY_PATH MANPATH HELPPATH PATH LOGNAME TERM

##################################################################

if [ -f $HOME/.Xdefaults ]; then xrdb $HOME/.Xdefaults # Load user's X11 resource database else xrdb $OPENWINHOME/lib/Xdefaults # Load def X11 resource database fi

if [ -f $HOME/.kypd_to_L -a -f $OPENWINHOME/bin/xmodmap ]; then

# Remap keypad to the "L" keys

$OPENWINHOME/bin/xmodmap -e "keysym F1 = Help"\ -e "keysym KP_1 = L1"\ -e "keysym KP_2 = L2"\ -e "keysym KP_3 = L3"\ -e "keysym KP_4 = L4"\ -e "keysym KP_5 = L5"\ -e "keysym KP_6 = L6"\ -e "keysym KP_7 = L7"\ -e "keysym KP_8 = L8"\ -e "keysym KP_9 = L9"\ -e "keysym KP_0 = L10"

fi ############ FOR SOLARIS 2.x HOSTS, THERE IS NO 'modules' DIRECTORY ########## ############ HOWEVER, WE KNOW THAT SOLARIS 2.x HOSTS WILL ALWAYS########## ############ BE RUNNING OPENWINDOWS 3.x ########## # if [ -d $OPENWINHOME/modules ]; then openwin_version=LATER_THAN_V2 # fi

shell=`/bin/basename $SHELL` # Find the user's shell type profile=""

if [ "$shell" = "csh" -a -f $HOME/.login ]; then profile=$HOME/.login elif [ "$shell" = "sh" -a -f $HOME/.profile ]; then profile=$HOME/.profile fi

# Please comment out the following line if you would like # $HOME/.login or $HOME/.profile to be executed when # you log in. Errors will be reported in $HOME/.xdm-errors. profile=""

if [ "$openwin_version" = "LATER_THAN_V2" ]; then

if [ -f $HOME/.openwin-init ]; then sed -e '/cmdtool/s/-C//' \ -e '/toolwait/s/$/\&/' \ -e 's/toolwait//' \ $HOME/.openwin-init | grep "Wp" > $HOME/.openwin-init.xdm startup=$HOME/.openwin-init.xdm chmod +x $startup

elif [ "$shell" = "csh" ]; then startup='$OPENWINHOME/bin/xview/cmdtool \ -Wp 0 0 -Ws 590 177 &; $OPENWINHOME/bin/xview/filemgr \ -Wp 0 120 -Ws 590 300 &' fi

elif [ -f $HOME/.openwin-init ]; then sed -e '/cmdtool/s/-C//' \ -e 's/cmdtool/\/usr\/etc\/setsid -b cmdtool/' \ -e 's/shelltool/\/usr\/etc\/setsid -b shelltool/' \ -e '/toolwait/s/$/\&/' \ -e 's/toolwait//' \ $HOME/.openwin-init | grep "Wp" > $HOME/.openwin-init.xdm startup=$HOME/.openwin-init.xdm chmod +x $startup

elif [ "$shell" = "csh" ]; then startup='/usr/etc/setsid -b $OPENWINHOME/bin/xview/cmdtool \ -Wp 0 0 -Ws 590 177 &; $OPENWINHOME/bin/xview/filemgr \ -Wp 0 120 -Ws 590 300 &'

fi

if [ "$shell" = "csh" ]; then

########################################################### # # C-shell startup environment

if [ $profile ]; then

# Source $HOME/.login and startup environment

exec $SHELL -f -c "source $profile; $startup; \ source $profile; $OPENWINHOME/bin/olwm"

else exec $SHELL -f -c "$startup; $OPENWINHOME/bin/olwm" fi

else

############################################################ # # Bourne (or other) shell startup environment

if [ $profile ]; then . $profile # Run $profile if it exists fi

if [ -f $HOME/.openwin-init ]; then

. $startup # Start Custom Workspace

else if [ "$openwin_version" = "LATER_THAN_V2" ]; then

$OPENWINHOME/bin/xview/cmdtool -Wp 0 0 -Ws 590 77 &

else

/usr/etc/setsid -b $OPENWINHOME/bin/xview/cmdtool \ -Wp 0 0 -Ws 590 77 & fi

$OPENWINHOME/bin/xview/filemgr -Wp 0 120 -Ws 590 300 & fi

$OPENWINHOME/bin/olwm # Start Window Mgr

############################################################ fi

fi

--PART-BOUNDARY=.19410121141.ZM8977.ncd.com--

David, We had a similar problem with xdm and openwindows, it turned out to be the .openwin-init file. Our system, Sun 690 4.1.3, is using DNS and xdm. The fix we did was to edit the .openwin-init file after saving desktop changes and change the period to a colon.

----------------------------------------------------------------------------- #!/bin/sh # .openwin-init - OpenWindows initialization script. # WARNING: This file is automatically generated. # Any changes you make here will be lost! export DISPLAY IFS=. SETBASEDISPLAY() { BASEDISPLAY=$1; } SETBASEDISPLAY ${DISPLAY} IFS= SETDISPLAYSCREEN() { # # The following line has been modified fro a period "." to # a colon ":" because of a bug with openwindows and DNS. # DISPLAY=${BASEDISPLAY}:$1 if winsysck x11 ; then : else echo No display available for screen $1 exit 1 fi eval `svenv -env` } # Note: toolwait is a utility to control client startup. # For more information, see the toolwait(1) man page. # # Start clients on screen 0 # SETDISPLAYSCREEN 0 # toolwait clock -Wp 0 0 -Ws 159 87 -WP 3 701 +Wi +Wn -digital +date toolwait filemgr -Wp 310 7 -Ws 632 745 -WP 13 127 -Wi -r -i 5 toolwait mailtool -Wp 286 115 -Ws 585 281 -WP 92 128 -Wi

-------------------------------------------------------------------------

This is not a great fix because every time you save the changes of your desktop the file is written over and the problem shows up again until you edit the file and make the appropriate changes. One way we get around this is to setup the environment for our users and then bury the save changes option deep in the menu interface. Kludgy but it works. :-)

The problem has something to do with the IFS=. statement but there appears no way to change it because the .openwin-init file is automatically generated.

If you get any responses that might fix the problem permanently I'd appreciate a copy of the summary.

Hope this helps.

Richard N. Cleary _/_/_/ _/ _/ _/ SANDIA NATIONAL LABORATORIES _/_/_/ _/ _/_/ _/ _/ P.O. Box 5800 _/_/ _/_/_/ _/ _/ _/ _/ Albuquerque, NM 87185-1193 _/_/_/_/_/_/ _/ _/ _/_/ _/ rnclear@sandia.gov - E-Mail _/ _/_/ _/ _/_/_/ _/ _/ _/_/_/_/ 505/845-7836 - Phone (voice-mail) _/ _/_/ _/

I have just been pulling xdm up on our site.

One thing I noticed is that in

/usr/openwin/lib/xdm/Xsession

says exec $startup

where startup=$HOME/.xinitrc.

This works only if $HOME/.xinitrc is executable. And then the users .openwin-init is not run.

One workaround is to

exec /bin/sh $startup

instead, (or chmod +x .xinitrc).

Perhaps this is your problem.

I have also modified the xdm-scripts to do an user login, before running the users's .xinitrc file. There were some problems if the users login shell is csh.

Let me know if your'e interrested in my hack.

Best Regards

Per Ekesson Carmenta AB SWEDEN

Create a .xsession in the users home directory. (see /usr/openwin/lib/xdm/Xsession) sma@intech.com Steve Aldous

I don't know if this is your problem or not, but we had a problem like yours due to the fact that we run the ksh shell here. The XDM software uses $USER while the ksh uses $LOGNAME - This difference will mess up the user's initial startup. Sun has a env disclaimer for XDM, so we modified the users /etc/profile for it all to work for both the XDM and non-XDM envronments. Kevin Rohan

The save workspace piece is broken on Sol 2.3. The workaround that I took was to manually modify the .openwin-init file and then never select the "save workspace" option from the desktop.

T Hill

Dave,

The user needs to have an executable .Xsession file in his home directory. Example:

#!/bin/csh

if (! $?DISPLAY) then setenv DISPLAY ${HOST}:0 endif

#---- .xinitrc ----#

xrdb $HOME/.Xdefaults $OPENWINHOME/lib/openwin-sys olwm &

#---- .openwin-init ----#

cmdtool -Wp 0 0 -Ws 595 65 -Wl "" -WP 0 0 -WL "" +Wi -Wb 227 255 225 & shelltool -Wp 0 96 -Ws 594 628 -WP 0 0 +Wi -Wb 195 237 255 & mailtool -Wp 64 64 -Ws 800 300 -WP 610 2 -Wi -Wb 255 255 210 &

wait exit

Hope this helps. Tom ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tom Kinter tmk@mayo.edu 507-284-4981 Mayo Foundation Rochester, Minnesota 55905 USA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When you use 'save workspace' it writes out .openwin-init. When openwindows starts up from the command line (ie you run /usr/openwin/bin/openwin) it looks for this file and runs it to start all the user's deskset tools, etc. xdm usually runs a script called /usr/openwin/lib/xdm/Xsession. You need to modify this file to look for the .openwin-init file and run it as appropriate.

BTW I don't think living with openwindows is such a chore now they have X11R5 (who knows how long before X11R6?).

regards, -- Glenn Satchell glenn@uniq.com.au | It doesn't matter what Uniq Professional Services Pty Ltd ACN 056 279 335 | temperature the room PO Box 70, Paddington, NSW 2021, (Sydney) Australia | is, it's always room Phone 02 380 6360 Pager 016 287 000 Fax 02 380 6416 | temperature. Steve Wright

Look in /usr/lib/X11/xdm (or in /usr/local/lib/X11/xdm or in /usr/openwin/lib/xdm) to see if there are standard startup scripts.

As far as saving workspace, I know that it works ONLY with XView applications (as opposed to xterm, xclipboard, etc.). But I do not understand why it does not work with cmdtool & filemanager. -------------------------------------------------------------- Haim (Howard) Roman E-mail: roman@brachot.jct.ac.il Computer Center Phone: +972-2-751 160 (work) Jerusalem College of Technology +972-2-963 502 (home) FAX: +972-2-422 075

Dear David,

we had the same problem and changed our Xsession-file. Perhaps You find something usefull

Dieter

-- Dr. med. dipl.-math Dieter Becker Tel.: (0 / +49) 6841 - 16 3046 Medizinische Universitaets- und Poliklinik Fax.: (0 / +49) 6841 - 16 3369 Innere Medizin III D - 66421 Homburg / Saar Email: db@med-in.uni-sb.de

#!/bin/sh # $XConsortium: Xsession,v 1.7 92/08/06 11:08:14 gildea Exp $

# redirect errors to a file in user's home directory if we can for errfile in "$HOME/.xsession-errors" "/tmp/xses-$USER" do if ( cp /dev/null "$errfile" 2> /dev/null ) then chmod 600 "$errfile" exec > "$errfile" 2>&1 break fi done

# /etc/profile ausfuehren, damit alle Benutzer die gleiche Startprozedur # durchlaufen . /etc/profile

if [ -f /etc/motd ]; then /opt/local/bin/xmessage -fg blue -bg orange -center -timeout 30 -file /etc/motd & fi

case $# in 1) case $1 in failsafe) exec xterm -geometry 80x24-0-0 ;; esac esac

startup=$HOME/.xinitrc

if [ -f $startup ]; then exec $startup else exec /bin/sh /usr/openwin/lib/Xinitrc #olwm & #exec xterm -geometry 80x24+10+10 -ls fi

-- David Robson (ROBBO),BHP Information Technology, P.O.Box 21, Whyalla South Australia 5600, Ph: +61 86 404596 Fax:...404720, E-mail dave@lpdwhy.bhp.com.au Disclaimer: This is MY mail and I speak for myself and I. %-)



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:12 CDT