home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / aix / 12690 < prev    next >
Encoding:
Text File  |  1992-12-21  |  4.1 KB  |  153 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!caen!batcomputer!lynx@msc.cornell.edu!jaguar.msc.cornell.edu!rick
  3. From: rick@jaguar.msc.cornell.edu (Rick Cochran)
  4. Subject: Re: XDM, Ksh, mwm, and nothing works
  5. Message-ID: <1992Dec18.171924.5252@msc.cornell.edu>
  6. Sender: news@msc.cornell.edu
  7. Organization: Cornell Materials Science Center
  8. References: <1992Dec7.174412.5605@ncs.com> <1g0jppINNfl9@unidui.uni-duisburg.de> <eswu.723933933@waterloo.austin.ibm.com> <1992Dec17.142843.8910@email.tuwien.ac.at>
  9. Date: Fri, 18 Dec 1992 17:19:24 GMT
  10. Lines: 141
  11.  
  12. I have finally managed to get an AFS authenticating version of MIT R5
  13. xdm working on my AIX 3.2.2+ machines.  The below also applies to
  14. MIT R5 xdm without AFS authentication.
  15.  
  16. I had to use a wrapper to start the X server.  "-sdebug" DID NOT WORK!
  17. The wrapper sets up /dev/hft as its controlling terminal, then execs
  18. /usr/bin/X11/X.
  19.  
  20. I also had to patch X11R5/mit/lib/X/XConnDis.c to get unix domain sockets
  21. to work properly under AIX 3.2.2+.  Without this patch, you have to use
  22. "host:0" rather than ":0" as your display, thus using TCP sockets, thus
  23. running more slowly.
  24.  
  25. I also had to start xdm in such a way as to get root's limits instead of
  26. the limits which the init process has.
  27.  
  28. I include the details below:
  29.  
  30. excerpt from /etc/rc.local:
  31. if [ -f /usr/local/X11R5/bin/xdm -a -f /usr/local/xdmR5/xdm-config ] ; then
  32.     su root "-c /usr/local/X11R5/bin/xdm -config /usr/local/xdmR5/xdm-config"
  33. fi
  34.  
  35.  
  36. Xservers file:
  37. :0      local   /usr/local/xdmR5/xwrap -D /usr/lib/X11/rgb -x dps -T
  38.  
  39.  
  40. Patch to X11R5/mit/lib/X/XConnDis.c:
  41. *** XConnDis.c.orig     Fri Nov  6 14:13:13 1992
  42. --- XConnDis.c  Thu Nov 19 13:19:09 1992
  43. ***************
  44. *** 450,458 ****
  45.  
  46.       unaddr.sun_family = AF_UNIX;
  47.       sprintf (unaddr.sun_path, "%s%d", X_UNIX_PATH, idisplay);
  48.  
  49.       addr = (struct sockaddr *) &unaddr;
  50. !     addrlen = strlen(unaddr.sun_path) + sizeof(unaddr.sun_family);
  51.  
  52.   #ifdef hpux /* this is disgusting */
  53.       ounaddr.sun_family = AF_UNIX;
  54. --- 450,459 ----
  55.  
  56.       unaddr.sun_family = AF_UNIX;
  57.       sprintf (unaddr.sun_path, "%s%d", X_UNIX_PATH, idisplay);
  58. +     unaddr.sun_len = strlen(unaddr.sun_path);
  59.  
  60.       addr = (struct sockaddr *) &unaddr;
  61. !     addrlen = (sizeof(unaddr) - sizeof(unaddr.sun_path) + unaddr.sun_len);
  62.  
  63.   #ifdef hpux /* this is disgusting */
  64.       ounaddr.sun_family = AF_UNIX;
  65.  
  66.  
  67. Source code for xwrap:
  68. /*
  69.  *    X wrapper for AIX 3.2 server by Drew Eckhardt
  70.  *
  71.  *     The Xserver needs to run with a hft as a controlling tty.
  72.  *    This wrapper does just that.
  73.  */
  74.  
  75. #include <stdio.h>
  76. #include <sys/file.h>
  77. #include <sys/ioctl.h>
  78.  
  79. /*
  80.  *     I tried moving the server to /usr/lpp/X11/bin/X.real, 
  81.  *    it puked all over - some shared library problem.
  82.  */
  83.  
  84. #ifndef SERVER
  85. #define SERVER "/usr/lpp/X11/bin/X"
  86. #endif
  87.  
  88. /*
  89.  *    /dev/hft  means the "first free virtual terminal".
  90.  */
  91.  
  92. #ifndef HFT
  93. #define HFT "/dev/hft"
  94. #endif
  95.  
  96. void main (int argc, char **argv, char **envp) {
  97.     int pgrp, f;
  98.  
  99. /*
  100.  *    First, we must disconnect from the controlling terminal 
  101.  *    (if there is one)
  102.  */
  103.     
  104.     if ((f = open("/dev/tty", O_WRONLY)) >= 0) {
  105.  
  106.         if (ioctl(f, TIOCNOTTY, 0) < 0) {
  107.             fprintf(stderr, "%s : TIOCNOTTY ioctl failed ", 
  108.                 argv[0]);
  109.             perror("");
  110.             exit(1);
  111.         }
  112.  
  113.         close(f);
  114.     }
  115.  
  116.     close(0);
  117.     close(1);
  118.  
  119. /*
  120.  *    Now, we get our own process group, and session.  This lets 
  121.  *    us associate with a new controlling tty.
  122.  */
  123.  
  124.     if ((pgrp = setpgrp()) < 0) {
  125.         fprintf(stderr, "%s : setpgrp() failed ", argv[0]);
  126.         perror("");
  127.         exit(1);
  128.     }
  129.  
  130. /*
  131.  *    Since we have no controlling tty, and the HFT we want 
  132.  *    has no session / pgrp associated with it, when we open it,
  133.  *    it will become our controlling tty.
  134.  */
  135.  
  136.     if (open(HFT, O_RDONLY, 0) < 0 ||
  137.         open(HFT, O_WRONLY, 0) < 0) {
  138.         fprintf(stderr, "%s : open failed on %s ", argv[0], HFT);
  139.         perror("");
  140.         exit(1);
  141.     }
  142.  
  143.     execv(SERVER, argv, envp);
  144.     fprintf(stderr, "%s : exec %s failed ", argv[0], SERVER);
  145.     perror("");
  146.     exit(1);
  147. }
  148.  
  149. -- 
  150. |Rick Cochran          607-255-7223             rick@msc.cornell.edu|
  151. |Cornell Materials Science Center             rick@crnlmsc2.bitnet|
  152. |E20 Clark Hall, Ithaca, N.Y. 14853         cornell!msc.cornell.edu!rick|
  153.