Re: Files in /tmp/.X11-unix not getting cleaned up..

2004-11-04 Thread David Suarez
Thanks Alexander.  I've done the below and it is working great now.  I
ran into the following questions/issues while attempting the below:

1.  When using cygpath -m ...  the home directories we use were
returning split over multiple lines sometimes (C:/
Documents and Settings/...).  Not for everyone.  Are there any
known issues with this?  The mount command worked fine and you could see
the mount installed using the mount command (also split over multiple
lines) however trying to cd /tmp resulted in an error.  To avoid the
multi-lines, I created a windows environment variable with the location
and used that instead when setting the mount.  Now that it's on one-line
everything works great.

2.  Seems like mapping a /tmp as a user-mount is a work-around.  Any
idea why the files don't get cleaned up in general?  Are there any known
issues with this approach?  Is there a resource that would be able to
fix the implementation to ensure the files are deleted?  The one concern
I have is I don't know if there are any applications out there that
would rely on a shared /tmp directory.  Since in regular unix /tmp is
shared, I can see how a program may rely on that causing a problem in
our case here now that /tmp is mapped individually by user.  For now,
this isn't a problem since we're using TS to run apps against the unix
boxes but I wonder if this limits our ability to expand cygwin usage in
the future as a stand-alone environment not linked to the unix boxes.

Please advise any experience/thoughts you have on the above.

Thanks again for the help!

Regards...djsuarez


* From: Alexander Gottwald Alexander dot Gottwald at s1999 dot
tu-chemnitz dot de 
* To: cygwin-xfree at cygwin dot com 
* Date: Wed, 3 Nov 2004 00:27:07 +0100 (MET) 
* Subject: Re: Files in /tmp/.X11-unix not getting cleaned up.. 
* References: [EMAIL PROTECTED] 
* Reply-to: cygwin-xfree at cygwin dot com 

David Suarez wrote:



 I have setup Cygwin/X on Windows Terminal Services and have been
running it using the approach that each new user gets there own port.?

 Everything runs dandy except under some circumstance it appears the
socket/file in the /tmp/.X11-unix/ directory is not cleaned up when X is
closed.? In those cases, on startup for a non-admin rights user, they
receive a fatal error.? To fix all I do is go into the directory and
delete the offending file (I confirm that there is no X server on that
port first).? Since the work-around works, I attempted to add that to
the script the user's kick off to delete the hanging file if it's
there.? Unfortunately since this only happens if the previous user of
that port was different, a permission error occurs.

this a quite often asked question. You could solve this with per-user
mounted
/tmp directory. eg.

mkdir $HOME/tmp
mount -buf $(cygpath -m $HOME/tmp) /tmp

This will create a temp directory in the users home directory and map
/tmp
to that directory.

bye
ago
NP: Megadump - Superhuman
-- 
 [EMAIL PROTECTED]
 http://www.gotti.org   ICQ: 126018723




Re: Files in /tmp/.X11-unix not getting cleaned up..

2004-11-04 Thread Alexander Gottwald
David Suarez wrote:

 Thanks Alexander.  I've done the below and it is working great now.  I
 ran into the following questions/issues while attempting the below:

 1.  When using cygpath -m ...  the home directories we use were
 returning split over multiple lines sometimes (C:/
   Documents and Settings/...).  Not for everyone.  Are there any
 known issues with this?  The mount command worked fine and you could see
 the mount installed using the mount command (also split over multiple
 lines) however trying to cd /tmp resulted in an error.  To avoid the
 multi-lines, I created a windows environment variable with the location
 and used that instead when setting the mount.  Now that it's on one-line
 everything works great.

Hm. I think you'll have to quote the strings
winpath=`cygpath -m $HOME/tmp`
mount -buf $winpath /tmp


 2.  Seems like mapping a /tmp as a user-mount is a work-around.  Any
 idea why the files don't get cleaned up in general?

On unix they are cleaned up on start. That's why the xserver is installed
with suid root on some systems. This does not work on cygwin.

 Are there any known
 issues with this approach?  Is there a resource that would be able to
 fix the implementation to ensure the files are deleted?  The one concern
 I have is I don't know if there are any applications out there that
 would rely on a shared /tmp directory.  Since in regular unix /tmp is
 shared, I can see how a program may rely on that causing a problem in
 our case here now that /tmp is mapped individually by user.

you will not be able to have user A start the xserver and user B connect
to that xserver (at least not via unix sockets)

 For now,
 this isn't a problem since we're using TS to run apps against the unix
 boxes but I wonder if this limits our ability to expand cygwin usage in
 the future as a stand-alone environment not linked to the unix boxes.

you can disable the unix sockets at all.

XWin -nolisten local

You will not be able to connect to :0.0 but 127.0.0.1:0.0 will work.

bye
ago
NP: L'Âme Immortelle - Crimson Skies
-- 
 [EMAIL PROTECTED]
 http://www.gotti.org   ICQ: 126018723


Re: Files in /tmp/.X11-unix not getting cleaned up..

2004-11-02 Thread Alexander Gottwald
David Suarez wrote:



 I have setup Cygwin/X on Windows Terminal Services and have been running it using 
 the approach that each new user gets there own port. 

 Everything runs dandy except under some circumstance it appears the socket/file in 
 the /tmp/.X11-unix/ directory is not cleaned up when X is closed.  In those cases, 
 on startup for a non-admin rights user, they receive a fatal error.  To fix all I do 
 is go into the directory and delete the offending file (I confirm that there is no X 
 server on that port first).  Since the work-around works, I attempted to add that 
 to the script the user's kick off to delete the hanging file if it's there.  
 Unfortunately since this only happens if the previous user of that port was 
 different, a permission error occurs.

this a quite often asked question. You could solve this with per-user mounted
/tmp directory. eg.

mkdir $HOME/tmp
mount -buf $(cygpath -m $HOME/tmp) /tmp

This will create a temp directory in the users home directory and map /tmp
to that directory.

bye
ago
NP: Megadump - Superhuman
-- 
 [EMAIL PROTECTED]
 http://www.gotti.org   ICQ: 126018723


Files in /tmp/.X11-unix not getting cleaned up..

2004-11-01 Thread David Suarez


I have setup Cygwin/X on Windows Terminal Services and have been running it using the 
approach that each new user gets there own port.  

Everything runs dandy except under some circumstance it appears the socket/file in the 
/tmp/.X11-unix/ directory is not cleaned up when X is closed.  In those cases, on 
startup for a non-admin rights user, they receive a fatal error.  To fix all I do is 
go into the directory and delete the offending file (I confirm that there is no X 
server on that port first).  Since the work-around works, I attempted to add that to 
the script the user's kick off to delete the hanging file if it's there.  
Unfortunately since this only happens if the previous user of that port was different, 
a permission error occurs.

This is what the scenario looks like in the file system:

[EMAIL PROTECTED] /tmp/.X11-unix
$ ls -la
total 4
drwxrwxrwt+   2 David.Te Domain U    0 Oct 29 11:04 .
drwxrwxrwx+   3 Administ Users    4096 Oct 29 11:53 ..
srwxrwxrwx    1 ranen    Domain A   51 Oct 27 09:07 X0
srwxrwxrwx    1 Suarez.D Domain U   51 Oct 29 11:04 X1
srwxrwxrwx    1 David.Te Domain U   51 Oct 26 09:54 X3

So right now, the last user to start X on 0 was ranen, on 1 was suarez.David, etc...

Now if I check the ports, only X0 is still in use.  So the other X servers on 1 and 3 
have since been closed but the files are still sticking around.  If I get assigned to 
any of these other ports I don't run into a problem because I am an admin user and it 
appears X checks to see if it's valid on startup and appropriately updates it.  
However for non-admin users, they get the fatal error.

I added to the script to delete the file if the X server is not in use but I get the 
permissioning error when they run.

Any idea what I can do to work around this behaviour?

Please advise...djsuarez