This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: W2K Terminal Services and multiple users running X


Harold,

> ... but the true difficulty in that is communicating the assigned
> display number back to the shell from which XWin was launched so that X
> programs can know the correct display to connect to.

Why not have XWin write its display number to a file in /var/run, e.g.,
/var/run/XWin.$$.display, where "$$" stands for the PID of the XWin
process?  Since anyone who started XWin in the background from a shell
script will have access to its PID via $!, the following idiom will work:

	XWin -multiwindow -emulate3buttons &
	XWINPID=$!
	DISPLAY_FILE=/var/run/XWin.$XWINPID.display
	while [ ! -e "$DISPLAY_FILE" ]; do sleep 1; done
	DISPLAY="`cat "$DISPLAY_FILE"`"

Unfortunately, this approach won't work from .bat scripts (since they
aren't aware of Cygwin process IDs).  It also won't work if "cygstart
XWin" is used.  Any ideas on how to address it?
	Igor

On Wed, 24 Mar 2004, Harold L Hunt II wrote:

> Joel,
>
> Each user needs a unique display number, which is specified as N in the
> following:
>
> XWin :N
>
> Such as:
>
> XWin :0 (default display zero)
> XWin :1 (display one)
>
> You can either hard-code these in startup scripts for each user, or you
> can help us with the feature that automatically assigns display
> numbers... but the true difficulty in that is communicating the assigned
> display number back to the shell from which XWin was launched so that X
> programs can know the correct display to connect to.
>
> Harold
>
> Joel Moots wrote:
>
> > I am able to successfully run XWin after logging onto a W2K Server via
> > Terminal Services, but if another user attempts to do the same thing at
> > the same time, she is not allowed. Is there some way to set this up so
> > that 2 instances of XWin can be running at the same time? Do we each
> > need our own Cygwin /tmp dir?
> >
> > I found many references to Terminal Services in the mail list archives
> > but none pertaining to multiple users.
> >
> > TIA,
> > -joel

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]