home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / aix / 8828 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  3.4 KB

  1. Path: sparky!uunet!stanford.edu!unixhub!unixhub.slac.stanford.edu!alhy
  2. From: alhy@unixhub.slac.stanford.edu (J. Scott Berg)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: xterm: no available ptys
  5. Message-ID: <5112@unixhub.SLAC.Stanford.EDU>
  6. Date: 15 Aug 92 00:10:07 GMT
  7. References: <BIS.92Aug14124438@maud.ifi.uio.no> <1992Aug14.223914.401@iscnvx.lmsc.lockheed.com>
  8. Sender: news@unixhub.SLAC.Stanford.EDU
  9. Reply-To: alhy@unixhub.slac.stanford.edu
  10. Organization: Stanford University, dept of Physics / SLAC
  11. Lines: 77
  12. Nntp-Posting-Host: courant.slac.stanford.edu
  13.  
  14. In article <1992Aug14.223914.401@iscnvx.lmsc.lockheed.com>, rahner@iscnvx.lmsc.lockheed.com (Mark Rahner) writes:
  15. |> bis@ifi.uio.no (Bjorn Ivar Stark) writes:
  16. |> : When I try to start more than a certain limit of xterms I get
  17. |> : this error-message:
  18. |> :     fosli@asterix: xterm
  19. |> :     xterm: no available ptys
  20. |> 
  21. |> This has given us massive headaches.  Our system administrator has
  22. |> increased one of our RS/6000s to what he says is the limit of 64.
  23. |> Sorry, but I don't know how.
  24. |> 
  25. |> When we first reported this to IBM, IBM said "Xterm is provided on the
  26. |> RISC/6000 as a binary sample only and is unsupported."  (More on this in
  27. |> a minute.)  After explaining to the #!%&*s that the problem wasn't with
  28. |> xterm, but with their system chewing up ptys, they reexamined the problem
  29. |> and determined that the software that controls our many X Stations was
  30. |> not properly releasing the ptys when the X Stations were being turned
  31. |> off.  As yet, this has not been fixed.
  32. |> 
  33.  
  34. If your problem is what I think it is, the following fix MAY (no
  35. guarantees) work:  before exiting mwm (I'm assuming that's what you're
  36. running), execute the following perl script:
  37.  
  38. #!/usr/local/bin/perl
  39. #
  40. # Exit gracefully from an x windows session on an RS6000--i.e., don't leave
  41. # behind any csh's.  At the same time, don't kill anything unnecessarily.
  42. #
  43. $indx = 0;
  44. # Get a list of processes
  45. open(psout,"ps lgxw |");
  46. while (<psout>) {
  47.   $psout[$indx++] = $_;
  48. }
  49. close(psout);
  50. $cmd =  "kill -9";
  51. for ($i = 0 ; $i < $indx ; $i++) {
  52.   @psline = split(/ +/,$psout[$i]);
  53.   if (("$psline[3]" eq "$<") && ("$psline[5]" ne "$$") && 
  54.       ("$psline[11]" eq "EVENT") && !($psline[12] =~ /hft\/[0-9]/) &&
  55.       (($psline[14] =~ /^-?[bck]?sh/) || ($psline[14] =~ /^-?tcsh/))) {
  56.     for ($j = 0 ; $j < $indx ; $j++) {
  57.       @xtst = split(/ +/,$psout[$j]);
  58.       last if (("$psline[5]" eq "$xtst[4]") && ($xtst[13] =~ /^xterm/));
  59.     }
  60.     if ($j != $indx) {
  61.       $cmd = "$cmd $psline[4]";
  62.     }
  63.   }
  64. }
  65. exec $cmd;
  66.  
  67.  
  68. Here's what it does:  it does a ps lgxw to find all the shells that
  69. are children of xterms and have this "EVENT" state set, and kills
  70. them.  These seem to be the things that are hanging around that are
  71. eating pty's.  As best as I can figure, the problem is in mwm, not the
  72. server.  That's a guess (running R3 or R5 server with twm doesn't seem
  73. to exhibit the problem at the moment).
  74.  
  75. I hope this is what you are looking for.  Good luck, and God bless
  76.  
  77.                 -Scott Berg
  78.  
  79. -- 
  80. -------------------------------------------------------------------------------
  81. The opinions expressed here are, of course, my own and nobody else's.
  82. -------------------------------------------------------------------------------
  83. J. Scott Berg
  84. email: alhy@unixhub.slac.stanford.edu
  85. real mail: Varian Physics
  86.            Stanford  CA  94305-4060
  87. phone:    (415) 926-4732 (w)
  88.      (415) 328-8246 (h)
  89. -------------------------------------------------------------------------------
  90.  
  91.