[nas] Solaris, SunRays and NAS

Jon Trulson jon at radscan.com
Sat Apr 21 15:17:39 MDT 2001


On Fri, 20 Apr 2001, Nick Ing-Simmons wrote:

> Date: Fri, 20 Apr 2001 12:58:59 +0100 (BST)
> From: Nick Ing-Simmons <nik at tiuk.ti.com>
> To: nas at radscan.com
> Subject: [nas] Solaris, SunRays and NAS
> 
> 
> The option to auto-start a server does not work well on SunRays.
> It spawns the nasd process fine, but does not pass it a listen argument.
> So if (as is the case here) the -laudio is trying to connect to 
> a server from $DISPLAY (say :27.0) then even though the server starts,
> it is listening on :0 so connect still fails.
> 
> Can anyone see why the connection number expected cannot be passed down, 
> either as command line or by "exporting" DISPLAY/AUDIOSERVER to the nasd
> process (and have it honour those).
> 

	None at all... I've attached a patch that should do this
properly.  It will look for AUDIOSERVER then DISPLAY.  If neither of these
are set, then :0 is assumed.  Of course specifying the port on the command
line takes precedence as usual.

	Let me know if it actually works ;-)

> Also what is the simplest way to make nas install itself in /usr/local/*
> rather than what /usr/openwin's configure suggests?
> 

	Supposedly, something like 'make install DESTDIR=/some/other/dir' 
will do the trick, though I've never tried this myself.

> It would also be nice to be able to build nas with gcc rather than 
> waiting in license queue for a 'cc' license... - but that is another 
> whole can of worms.
> 

	Yeah... Isn't that fun :-| Theoretically, you can do this with the
standard X env (from x.org)  by defining 'HasGcc2' in your systems
site.def file, and then hoping the proper CFLAGS et. al. are setup in
sun.cf.

	Of course a better way would be to use autoconf in NAS.  But, that
too is another can of worms ;-)

-- 
Jon Trulson    mailto:jon at radscan.com
ID: 1A9A2B09, FP: C23F328A721264E7 B6188192EC733962
PGP keys at http://radscan.com/~jon/PGPKeys.txt
#include <std/disclaimer.h>
Bad Color Temperature, Too much Peach.
-------------- next part --------------
Index: server/dia/main.c
===================================================================
RCS file: /home2/jon/src/repository/nas/server/dia/main.c,v
retrieving revision 1.7
diff -c -r1.7 main.c
*** main.c	2000/12/11 04:13:50	1.7
--- main.c	2001/04/21 20:55:39
***************
*** 71,78 ****
  extern void 	AuInitProcVectors();
  extern Bool     InitClientResources();
  
! extern char *display;
  
  static int restart = 0;
  FILE    *yyin;			/* for the config parser */
  
--- 71,80 ----
  extern void 	AuInitProcVectors();
  extern Bool     InitClientResources();
  
! static char *AuServerName(void);
  
+ extern char     *display;
+ 
  static int restart = 0;
  FILE    *yyin;			/* for the config parser */
  
***************
*** 126,137 ****
       * can't be passed argc, argv as parameters */
      argcGlobal = argc;
      argvGlobal = argv;
!     display = "0";
      ProcessCommandLine(argc, argv);
  
! 				/* JET - we don't actually become a
! 				   daemon, so what's the point?
! 				   REVISIT */
  
      /* We're running as a daemon, so close stdin, stdout and stderr
         before we start the main loop */
--- 128,141 ----
       * can't be passed argc, argv as parameters */
      argcGlobal = argc;
      argvGlobal = argv;
! 
!     display = NULL;
      ProcessCommandLine(argc, argv);
  
! 				/* if display wasn't spec'd on the command
! 				   line, find a suitable default */
!     if (display == NULL)
!       display = AuServerName();
  
      /* We're running as a daemon, so close stdin, stdout and stderr
         before we start the main loop */
***************
*** 184,187 ****
--- 188,228 ----
  	}
      }
      exit(0);
+ }
+ 
+ 
+ /* JET - get the server port to listen on here... uses AUDIOSERVER, then
+  *  DISPLAY if set.
+  */
+ 
+ static char *AuServerName (void)
+ {
+   char *name = NULL;
+   char *ch;
+ 
+     name = (char *) getenv ("AUDIOSERVER");
+     if (name)
+       {
+ 	if ((ch = strchr(name, ':')) != NULL)
+ 	  {
+ 	    ch++;
+ 	    return(ch);
+ 	  }
+ 	else
+ 	  return name;
+       }
+ 
+     name = (char *) getenv ("DISPLAY");
+     if (name)
+       {
+ 	if ((ch = strchr(name, ':')) != NULL)
+ 	  {
+ 	    ch++;
+ 	    return(ch);
+ 	  }
+ 	else
+ 	  return name;
+       }
+ 
+     return "0";
  }


More information about the Nas mailing list