Hints and Tips for the Common Desktop enviroment (CDE or DtLogin) This was the Solaris Workstation, X Windows Dektop Environment. ------------------------------------------------------------------------------- Short circuit CDE login The following ".dtprofile" script short circuits the dtsession script login to run a users `xdm' style login script. This is a BIG HACK. $HOME/.dtprofile =======8<-------- # # Anthony's DT Profile to short circuit CDE login to a XDM login # # This file is sourced by the DT Session script "/usr/dt/bin/Xsession" # script after it defines the way dt is to login, in the form of shell # variable arrays. Modifications here re-define the normal DT Session # initialisation and start up. # # NOTE: DT completely replaces any and all resource settings you may # setup within this profile! As such xrdb commands are usless here. # # ---------------------------------------------------------------------- # Source Users .profile or .login # # If "$HOME/.profile" (ksh) or "$HOME/.login" has been edited # so that the environment for DT is initialised (env var DT=true) # then CDE will source it if the following is uncommented # the following line. (I don't bother .xsession will handle it) # # DTSOURCEPROFILE=true # # ---------------------------------------------------------------------- # XDM Session startup # # The following will tell DT to start up as if it is an XDM Session. SESSIONTYPE=xdm # XDM style of session please ( ~/.xsession ) # Set the scripts to look for... # NOTE: scripts must be executable programs! xdmstart_session[0]="$HOME/.xsession" xdmstart_session[1]="$HOME/.xinitrc" xdmstart_session[2]="/usr/lib/X11/twm/Xsession" xdmstart_session[3]="xterm -geometry 80x24+10+10 -ls" xdmstart_hello="/opt/X11/bin/xconsole -daemon -notify -verbose -fn fixed -exitOn Fail &" #xdmstart_hello="" # if no console desired # Cycle any old log currently present rm -f .xsession-errors-prev [ -f .xsession-errors ] && mv .xsession-errors .xsession-errors-prev # Specify the log file location dtstart_sessionlogfile="$HOME/.xsession-errors" =======8<-------- ------------------------------------------------------------------------------- Make Dtterm Windows a `Login' Window WARNING: This does not seem to quite FIX the problem The Default CDE setup does NOT use a "-ls" option when creating terminal windows. As such while the .cshrc is started, the users .login isn't. However ".login" is run during CDE initialization (if specified in the users ".dtprofile", and the environment initialised. However when a ``Terminal'' is then run the ".cshrc" may destory any of the users path settings declared in the users ".login". EG: instead of the order ".cshrc" then ".login" the order has been inverted to ".login" (environment only) then ".cshrc" The Fix is to create the following file in the users ".dt" directory $HOME/.dt/types =======8<-------- # # Redefine the action used to launch a dtterm so a login shell is started # # Anthony Thyssen 6 August 1999 # ACTION Dtterm { LABEL Terminal ARG_COUNT 0 ICON Dtterm TYPE COMMAND WINDOW_TYPE NO_STDIO EXEC_STRING /usr/dt/bin/dtterm -ls } =======8<-------- this redefined the dtterm launaching `action' to include a "-ls" in the commands arguments. NOTE: this file is normally read before the systems version though the DT defined (or user redefined in ".dtprofile") environment variable DTDATABASESEARCHPATH. ------------------------------------------------------------------------------- CDE font server seting and remote XDM login on NON-NIS machines. The CDE xsession script "/usr/dt/bin/Xsession" will attempt to set the font path so that it can locate the special DT font aliases it uses. This is also the case in the "/usr/dt/config/Xsetup" script. For remote X terminals, it first tries a number of font directories in case these are NFS mounted on the Xterminal. It then will append the openwinds font server to the x servers font path. The problem however is that it does so with something like $XDIR/xset fp+ tcp/`hostname`.`domainname | cut -d. -f2-`:7100 This results in a machine name of either the hostname with a `.' appended or the hostname with the domain name appended, minus the first part of the domainname. For example if the machine is enterprise without and domain name the fontserver setting is... tcp/enterprise.:7100 The final `.' make this a FQDN but one which DOES NOT EXIST! If on the other hand enterprise has the domain set to its DNS domain which is one way it is suposed to work, it still comes out wrong... EG: If the FQDN of the machine is enterprise.xyzzy.foo.edu. you could logically set the domainname to xyzzy.foo.edu the fontserver addition request then becomes: tcp/enterprise.foo.edu:7100 which is again WRONG and does not exist. You can't win. The assumption being made in CDE is that there is always NIS running and that the NIS domainname has an additional prefix over the dns domainname. This is certainly the case at most sites, but this is not guaranteed. This results in the special DT font aliases not being know to remote X terminals, also on PCs using a X window emulator such as Xwin will popup ``Unknown Host'' error windows. which PC users find both confusing and anonying. SOLTIONS: 1/ As a temporary solution you can prepend the domain name with some junk echo this-is-junk.xyzzy > /etc/defaultdomain domainname `cat /etc/defaultdomain` which results in a fontserver setting... tcp/enterprise.xyzzy:7100 which with normal DNS lookups WILL WORK. 2/ As better solution you can modify the Xsession script work correctly for both NIS+ sun machines and machines without a domainname set. EG: do not add the "." to the end of hostname if the machines domain name is NOT set. =======8<-------- *** Xsession.orig Tue Jul 11 18:35:51 2000 --- Xsession Thu Aug 24 11:57:18 2000 *************** *** 521,527 **** # Will server any "-dt-" fonts not found on the remote machine. # if [ -x /usr/openwin/bin/fs ]; then ! $XDIR/xset fp+ tcp/`/usr/bin/hostname`.`/usr/bin/domainname | /usr/bin/cut -d. -f2-`:7100 fi fi --- 521,527 ---- # Will server any "-dt-" fonts not found on the remote machine. # if [ -x /usr/openwin/bin/fs ]; then ! $XDIR/xset fp+ tcp/`/usr/bin/hostname``/usr/bin/domainname | /usr/ucb/sed 's/^[^.]//'`:7100 fi fi =======8<-------- 3/ Fix Xsession to use the default DNS domain the machine is in, if found! =======8<-------- *** Xsession.orig Tue Jul 11 18:35:51 2000 --- Xsession.dns Thu Aug 24 12:00:50 2000 *************** *** 521,527 **** # Will server any "-dt-" fonts not found on the remote machine. # if [ -x /usr/openwin/bin/fs ]; then ! $XDIR/xset fp+ tcp/`/usr/bin/hostname`.`/usr/bin/domainname | /usr/bin/cut -d. -f2-`:7100 fi fi --- 521,527 ---- # Will server any "-dt-" fonts not found on the remote machine. # if [ -x /usr/openwin/bin/fs ]; then ! $XDIR/xset fp+ tcp/`/usr/bin/hostname``/usr/bin/awk '/^(domain|search)/{print "."$2;exit}' /etc/resolv.conf`:7100 fi fi =======8<-------- ------------------------------------------------------------------------------- Creating a New CDE Session In this case a ``OLD CIT Session'' in addition to the normal sessions available on Sun machines (CDE and Openwindows). Define a Old CIT session (for those without a local .xsession file) This should be modified to call a script to `setup' and call /usr/dt/bin/Xsession instead of launching directly. cat <-EOF > /opt/X11/lib/X11/twm/DTresources.old_cit Dtlogin*altDtsIncrement: True Dtlogin*altDtName: Old CIT Session Dtlogin*altDtKey: /opt/X11/bin/ctwm Dtlogin*altDtStart: /opt/X11/lib/X11/twm/DTsession.old_cit Dtlogin*altDtLogo: /opt/X11/lib/X11/twm/GUlogo EOF ln -s /opt/X11/lib/X11/twm/DTresources.old_cit \ /usr/dt/config/C/Xresources.d/Xresources.old_cit cat <-EOF > /opt/X11/libX11/twm/DTsession.old_cit #!/bin/ksh export SESSIONTYPE=altDt export SDT_ALT_SESSION="/opt/X11/lib/X11/twm/Xsession.xdm" export SDT_ALT_HELLO="/usr/dt/bin/dthello -string 'Old CIT Session' &" exec /usr/dt/bin/Xsession EOF From Old CIT setup (xdm) copied old session files libX11/twm/Environment libX11/twm/xmodmap.* libX11/twm/Xresources libX11/twm/Xsession libX11/twm/system.ctwmrc libX11/twm/system.twmrc Also libX11/twm/Xsession.xdm ( from libX11/xdm/Xsession in old set) These scripts only then require minor modifications for new Environment EG: the various path environment variables. And bitmap image paths etc. NOTE: since I worked this out I have created special PC Xwin sessions for use by some of the less computationally minded users... Minimal Session Which has only the clients: xterm, cm, filemgr it does not have any window manager or email. Calander Only Which only runs cm without a window manager This is for use by the school secretaries for appointment management. Terrys Poplog A minimal session of a Xterm, twm and a xved windows ------------------------------------------------------------------------------- CDE logins die regularly after 15 minutes The problem is that the server console doesn't have an associated framebuffer. CDE is attempting to start up the X Server on a server that has no framebuffer, and failing. When that happens the CDE processes die, bringing down all the CDE Xterminal connections to the server. To avoid this problem, modify Xservers as follows: 1. cp /usr/dt/config/Xservers /etc/dt/config 2. Comment out the following line in /etc/dt/config: :0 Local local_uid@console root /usr/openwin/bin/Xsun :0 -nobanner to: # :0 Local local_uid@console root /usr/openwin/bin/Xsun :0 -nobanner Extracted from Sun infodoc 16248 -------------------------------------------------------------------------------