[comp.windows.x] dxt

klein@lupine.UUCP (11/16/89)

  could you post such a script?

Certainly. A word of warning, though ... I backed all of this out after
finding that strange things seemed to be happening to my system, such
as the init proc gathering 1 hour of cpu time over a 12 hour wall clock
period :-(  I submit this to you with no guarantees - it worked ok for
me, but I didn't really have the time nor inclination to go back and
figure ought what was going on. I just passed the information back to
DEC. For various reasons I much prefer using xdm.



----- Sample /etc/ttys file ------

# 		 "@(#)ttys	4.1.1.3	(ULTRIX)	9/19/88"
#
#
#
# name	getty		type		status		comments
#
console	"/etc/getty std.9600" vt100 	on secure	# console terminal

(...lots of stuff cut out here for brevity...)

ttyqd	none		network
ttyqe	none		network
ttyqf	none		network
#:0 "/usr/bin/login -P /usr/bin/Xprompter -C /usr/bin/dxsession" none
on secure window="/usr/bin/Xcfb"
:11 "/usr/bin/login -P /usr/local/xprompter-ncd -C
/usr/local/start-ncd" none on secure 
:12 "/usr/bin/login -P /usr/local/xprompter-ncd -C
/usr/local/start-ncd" none on secure 

----- Sample /usr/local/xprompter-ncd -----

#!/bin/sh
#
# FILE NAME: xprompter-ncd
#
# This is a simple shell script to start the DEC Xprompter program on
# a non-local display. Note that it takes advantage of a naming convention
# in the /etc/ttys file. For more information, refer to the comments in
# the file "start-ncd"

	BASENAME=ncdu

# Use the first arg to determine the specific unit to display on:

	NUMBER=`echo $1|sed 's/://'`
	UNIT=${BASENAME}${NUMBER}

# Start the prompter:

	DISPLAY=${UNIT}:0
	export DISPLAY
	/usr/bin/Xprompter -display ${DISPLAY}:0


----- Sample /usr/local/start-ncd -----

#!/bin/sh
#
# FILE NAME: start-ncd
#
# This is a simple start up script for using DEC's Xprompter and /etc/ttys
# login window. It will start a simple uwm unless a .start-ncd script exists in
# the user's home directory.
#
# The trick to doing all of this is to realize that the login process under 
# Ultrix reads the /etc/ttys file looking for lines beginning with ":number".
# For each such line, it will start a process with the first argument being
# the :number. To make it work with "arbitrary" units, start shell scripts 
# instead of programs. The NCD's you wish included must have names using 
# some numbering scheme that can be tied back to this ttys number.
#
# For example, start with a base name convention:

	BASENAME=ncdu

# Then read the ttys line of the format:
#
# :11 "/u/bin/login -P /u/local/xprompter-ncd -C /u/local/start-ncd" none on
#
# with the commands:

	NUMBER=`echo $1|sed 's/://'`
	UNIT=${BASENAME}${NUMBER}

# Use this to the set the X DISPLAY variable:

	DISPLAY=$UNIT:0
	export DISPLAY

# Now you are ready to really start the user's "session". A variety of 
# environments can be built; this is a simple example using a user's 
# own start up file, or a system default.
#
# Check for the existence of a .start-ncd file in the home dir:

	if test -f $HOME/.start-ncd
	then
		sh $HOME/.start-ncd $DISPLAY
	else
		twm
	fi

# The only caveat to this mechanism at this point is that the user must
# truly stop all clients before the login banner will come back. (As you 
# would expect). Unfortunately there are no real "standard" means of enforcing
# this in a "friendly" manner. One mechanism is to just do an "xkill -a", but 
# this is not intuitively obvious or particularly safe.