[comp.sys.att] layers hangs terminal

kevin@msa3b.UUCP (Kevin P. Kleinfelter) (07/20/89)

I'm running layers on an AT&T 3B2, with Sys V R3.2.1, and an AT&T 630 tty.
I'm pretty pleased, but there is this problem...

If I accidentally do the following
	login successfully
	start layers
	do inconsequential stuff
	^D (without leaving layers)
	
The layer is "dead".  Since it is my only layer, the terminal is dead.
After killing off all the "xt" entries and "layers" and "ksh" that I can
find via "ps -e" from another terminal, the 630 is still dead.  Turning the
630 off and on does not help.  It is not available again until the system is
rebooted.

Two questions:
	1) How can I get my terminal back without a reboot?
	2) How can I tell (in a shell script) if layers is active on my tty?
	   (If I can set my prompt string, PS1 to say "LAYERS" I can
	    avoid trying to logout while layers is running.)

-- 
Kevin Kleinfelter @ Management Science America, Inc (404) 239-2347
gatech!nanovx!msa3b!kevin

msc@cbnewsc.ATT.COM (michael.s.cross) (07/26/89)

In article <676@msa3b.UUCP> writes:
>
>If I accidentally do the following
>	login successfully
>	start layers
>	do inconsequential stuff
>	^D (without leaving layers)
>	
>The layer is "dead".  Since it is my only layer, the terminal is dead.

Using an EOT (^D) causes that shell to terminate.  Make a new window or
exit layers.  The keyboard might be "dead", but the mouse is still functional.

This can piss me off at times too.  Especially when I exit ksh(1) on my
main window, but fortunatly the window that is created using "new" is a
24x80 window and I can use vi(1) from it just as well.

>After killing off all the "xt" entries and "layers" and "ksh" that I can
>find via "ps -e" from another terminal, the 630 is still dead.  Turning the
>630 off and on does not help.  It is not available again until the system is
>rebooted.

Try rebooting the 630 without killing any processes.
 
>Two questions:
>	1) How can I get my terminal back without a reboot?

Exit layers using the mouse. (see above)

>	2) How can I tell (in a shell script) if layers is active on my tty?
>	   (If I can set my prompt string, PS1 to say "LAYERS" I can
>	    avoid trying to logout while layers is running.)

I donno, maybe look for the "xt" and "layers" entries in the ps(1). (My system
says tty38 for a non-layers "window" and xt038 for a layers window.)

I use "layers -f .layerfig" to start layers. (.layerfig is a name I gave to my
layer configuration file)  I can make windows any size, change the PS1 ...
As far as saying LAYERS, *I* just look at the two little boxes in the top
left-hand corner.

Oh, what the H, here's my .layerfig:
---8K--cut here-------
# /* ttrdc: .layerfig */
#
# /* Taken from page 4-7 of the 630 Users Guide */
#
# Top Corner is 6,6 and the bottom corner is 1018,1018
# Height is (No Lines)*(Font Height)+34
# Width is (No Columns)*(Font Width)+29
#  Small Font is 7(wide)X14(High)
# Medium Font is 9(wide)X14(High)
# Large Font is 11(wide)X16(High) - (Default)
#
#                                        | 
#                 -->                    V 
# Large Font: 80 Cols (x11+29)=909  14 Lines (x16+34)=258  
#                                   24 Lines (x16+34)=418
#
#  Up-R |   Low-L |
# -->   V   -->   V
#
  917    6 1018  135  dmddemo clock
  917  138 1018  246  dmdlock -a 8 -b -l -u -c
  109  700 1018  958  cd ~/bin;swd;exec ksh
  109  275 1018  533  cd $CBRE;swd;exec sh
---8K--cut here-------

Mike

-- 
Michael S. Cross  (msc@ihc.ATT.COM)  (312)-982-2018
AT&T Bell Laboratories, 5555 Touhy Ave., Skokie, IL  60077
________________________To Live is to risk Dying______________________________

fmcgee@cuuxb.ATT.COM (~XT6510300~Frank McGee~C23~L25~6326~) (07/26/89)

In article <676@msa3b.UUCP> kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes:
>I'm running layers on an AT&T 3B2, with Sys V R3.2.1, and an AT&T 630 tty.
>I'm pretty pleased, but there is this problem...
>If I accidentally do the following
>	login successfully
>	start layers
>	do inconsequential stuff
>	^D (without leaving layers)
>The layer is "dead".  Since it is my only layer, the terminal is dead.
>After killing off all the "xt" entries and "layers" and "ksh" that I can
>find via "ps -e" from another terminal, the 630 is still dead.  Turning the
>630 off and on does not help.  It is not available again until the system is
>rebooted.
>Two questions:
>	1) How can I get my terminal back without a reboot?
>	2) How can I tell (in a shell script) if layers is active on my tty?
>	   (If I can set my prompt string, PS1 to say "LAYERS" I can
>	    avoid trying to logout while layers is running.)
>Kevin Kleinfelter @ Management Science America, Inc (404) 239-2347
>gatech!nanovx!msa3b!kevin

There are two issues here; the layers software and the cable used to
connect the terminal to the host.

If you type a ctrl-d in a shell running in a layers window the shell
will end, but layers won't exit until you tell it to.  You should still
be able to use the mouse, and pull down the 630 menu and there should
be an option to quit layers.  If you quit layers, you will have your
original login shell back (you will still be logged into the host) and
you can either logout from there or start layers again.  In addition I
believe there is an option from within the 630 menus to disconnect from
the host.  This won't quit layers on the host for you, but it will
disconnect you.

It also sounds like you aren't using a fully-wired cable to connect to
your host either.  If you are using a fully wired cabled, your serial
port on the host should be able to sense when you power down the 630,
and it should kill off all processes associated with that tty when it
senses that DTR has dropped.  If you are using a 3-wire serial cable
that's probably the reason why layers is hanging the port.  A fully
wired cable looks something like this (there are several variations) :

	host	630
	1     --  1
	2     --  3
	3     --  2
	4     --  5
	5     --  4
	6 & 8 -- 20
	7     --  7
	20    --  6 & 8

Basically pins 1 and 7 are straight through, you swap pins 2 and 3, you
swap pins 4 and 5, and tie 6 and 8 on each side to pin 20 on the other
side.   This cable will allow the serial port on your host to sense
that DTR has dropped and things will behave normally.  Some other
things to check would be /etc/gettydefs (make sure HUPCL is set),
/etc/inittab (make sure the tty you are coming in on is a hardware flow
control port), and make sure you aren't trapping signal 1 (SIGHUP) in
your .profile or /etc/profile.

I don't know how you could tell that you were running under layers from
within a shell script; you might want to try having another script that
sets an environment variable, exports it, then starts layers.
Something like :

LAYERS=YES
export LAYERS
layers

Hope this helps, good luck.

-- 
Frank McGee, AT&T
Tier 3 Indirect Channel Sales Support
attmail!fmcgee

wjc@ho5cad.ATT.COM (Bill Carpenter) (07/26/89)

In article <676@msa3b.UUCP> kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes:
>	2) How can I tell (in a shell script) if layers is active on my tty?
>	   (If I can set my prompt string, PS1 to say "LAYERS" I can
>	    avoid trying to logout while layers is running.)

The host software includes a command "ismpx" for just this purpose.
It answers "yes" or "no".  I think you can also get it to tell you via
the return code.
--
   Bill Carpenter         att!ho5cad!wjc  or  attmail!bill

ebh@argon.UUCP (Ed Horch) (07/28/89)

wjc@ho5cad.ATT.COM (Bill Carpenter) writes:
>In article <676@msa3b.UUCP> kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes:
>>	2) How can I tell (in a shell script) if layers is active on my tty?
>
>The host software includes a command "ismpx" for just this purpose.

Clarification:  The exit status of ismpx is as you'd expect: 0 if yes,
1 if no.  The "yes" and "no" outputs are sent to standard error, not
standard output.  Here is an example of the shell script I wrap aound 
my 630 executables:

	ismpx 2>/dev/null && exec dmdld whatever.m $*
	echo $0: Must be in layers environment >&2
	exit 1

The executable itself is "whatever.m".  In most cases the shell script 
[$0] is named "whatever", in keeping with the way things like cip are
distributed and installed.

Editorial question:  When are AT&T going to take this beauty and make
it into a full workstation?  All it needs is an Ethernet/Starlan/etc.
interface, more memory and CPU, some simple networking firmware, and a
slightly more intelligent operating system.  Is anything like that in
the works?

-Ed

hjespersen@trillium.waterloo.edu (Hans Jespersen) (07/28/89)

In article <676@msa3b.UUCP> kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes:

>	1) How can I get my terminal back without a reboot?

We had similar problems with all our 630's on attcan ( a 3B2/600 ).
The only way to get the terminal back was to pump the I/O board
( thus loosing everyone elses sessions on that particular card ).
Apparantly the problem was related to the use of 630s with EPORTS
cards. I personally didn't have to deal with the problem so I
obviously only have a vague understanding. I'd call the hotline
and check if there is a know bug with the EPORTS/630/layers 
combination.

-- 
Hans Jespersen
hjespersen@trillium.waterloo.edu
uunet!watmath!trillium!hjespersen

ami@kodkod.usc.edu (Ami Motro) (07/29/89)

In article <676@msa3b.UUCP> kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes:
>I'm running layers on an AT&T 3B2, with Sys V R3.2.1, and an AT&T 630 tty.
>I'm pretty pleased, but there is this problem...
>
>If I accidentally do the following
>	login successfully
>	start layers
>	do inconsequential stuff
>	^D (without leaving layers)
>	
>The layer is "dead". 

I used to have the same problem.  I now start the first shell in each window
with "ksh -o ignoreeof".  This gives the message "Use 'exit' to logout" when
you enter ^D.  Thus, I can use ^D to end nested shells or tools, without
risking that an extra ^D will freeze the window.

Ami