home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / aix / 11510 < prev    next >
Encoding:
Internet Message Format  |  1992-11-11  |  3.2 KB

  1. Path: sparky!uunet!westmx!rodkey
  2. From: rodkey@westmont.EDU (John Rodkey)
  3. Newsgroups: comp.unix.aix
  4. Subject: Question: What happens when a Terminal is powered-down?
  5. Summary: AIX 3.1.6 - how does it handle powering off a terminal on a NTS?
  6. Keywords: aix sigterm runaway pseudoterminals dynix UniVerse powerdown
  7. Message-ID: <319@westmx.westmont.edu>
  8. Date: 11 Nov 92 23:24:12 GMT
  9. Organization: Westmont College, Santa Barbara, CA
  10. Lines: 96
  11.  
  12.  
  13. I have this setup:  RS/6000 mod 530, AIX 3.1.6, UniVerse 5.4, DYNIX v. 1??
  14. Access to the RS/6000 from terminals is through Emulex and Lantronix 
  15. Network terminal servers.  This problem occurs on both, so I have made
  16. the assumption that the NTSs are not the weak link.
  17.  
  18. The terminals (wyse 50's, PCs w/ emulation, etc.) are accessing the
  19. RS/6000 in order to run the Library public access catalog, which is one
  20. of the options in a ksh menu program.
  21. DYNIX, the catalog program,  is using the UniVerse implementation of
  22. Pick, which is in turn layered over AIX.
  23.  
  24. Here's the problem:  when the users are done with the public catalog,
  25. they sometimes turn off the terminal, which creates a 'cpu-hog' on our
  26. system iff the user was using DYNIX at the time the plug was pulled.
  27.  
  28. By CPU hog, I mean that its number of cpu clicks on ps -ef, C column is
  29. between 20 and 120 (normally a cpu-intensive process shows about 12
  30. clicks - but if there are 20 hogs, each may have only 9, for example).
  31.  
  32. Clearly I need to get to the bottom of this problem.  Killing processes
  33. is repetitive, timewasting, etc.  
  34.  
  35. SO!  The question is:  what signals are issued to processes associated
  36. with a pty when the terminal powers down?  How does one handle those
  37. signals to avoid the problem described? How does ksh handle these differently
  38. than sh?
  39.  
  40. ----------------------------------------------
  41. fragments of typical code follow....
  42. ----------------------------------------------
  43. ~dynixlogin/.profile
  44.     # ...set path, etc  deleted...
  45.     cat <<TTYS
  46.            Please select your terminal type from the following list:"
  47.                  0) Log out
  48.                  1) Wyse or Adds Viewpoint
  49.                  2) VT100
  50.     TTYS
  51.     echo -n "           Your choice? ":
  52.     read ttype
  53.     case "$ttype" in
  54.         0) logout ;;
  55.         1) TERM=wy30  ; export TERM ;;
  56.         2) TERM=vt100 ; export TERM ;;
  57.         *) TERM=$ttype ;;
  58.     esac
  59.     /usr/local/bin/libmenu
  60.     logout
  61.     exit
  62. /usr/local/bin/libmenu
  63.     
  64.     trap "exit" 1
  65.  
  66.     optn=999
  67.     until [ "$optn" -eq 0 ]
  68.     do
  69.         sleep 1
  70.         optn=999
  71.         until [ "$optn" -ge 0 -a "$optn" -le 5 ]
  72.         do
  73.             clear
  74.             cat <<MENU
  75.         1) ROGER     (Voskuyl Library On-line Catalog)
  76.         2) ... other options deleted ...
  77.  
  78. MENU
  79.             echo -n "\n           Please enter the option number you desire( 1-5 ) : "
  80.             read optn 
  81.             optn=`echo $optn  | tr -cd 12345`
  82.             if [ -z "$optn" ]
  83.             then
  84.                 optn=999
  85.             fi
  86.         done
  87.         case "$optn" in  
  88.           1 ) clear 
  89.                Roger ;;
  90.           2 ) ... other options deleted ...
  91.         esac
  92.  
  93.     done
  94.     exit
  95.  
  96. ~dynixlogin/Roger
  97.     #!/bin/sh
  98.     #  we use sh here, because uv had problems with ksh
  99.  
  100.     uv MM # this calls up UniVerse, and goes into the main menu
  101. ---------------------------------------
  102. Anyone care to shed light on this subject?
  103. -- 
  104. ----------==========[[[[[[[[[[]]]]]]]]]]==========----------
  105.           John Rodkey, Director of Academic Computing, 
  106.             Westmont College, Santa Barbara, CA
  107.           rodkey@westmont.EDU, uunet!westmx!rodkey
  108.