[esp-r] how to unlock X-server in cygwin

Martin Bartak Martin.Bartak at fs.cvut.cz
Wed Jan 31 19:03:56 GMT 2007


This might be useful for those using Cygwin on Windows XP in
a multi-user environment.

On a PC/WinXP with several users who have different privileges
you might face a problem with locked X-server. I have recently
installed Cygwin v.1.5.23 and found that X-Win.exe (invoked by
the `startx´ command) did not work for users who were logged in
one after another. The reason is that Cygwin puts a lock on the
X-server and prevents another user to start it later on.

The lock is named X0 and is in /tmp/.X11-unix (in Cygwin) or 
C:\cygwin\tmp\.X11-unix (in Windows). The directory has a sticky
bit and X0 cannot be re-written or deleted by a user who is not
an owner of the lock. The lock persists after its owner has logged
out.

To solve the problem without digging into the system too much,
you can add just one line at the end of the file `cygwin.bat´ which
invokes Cygwin (i.e. the black window). The last line should be:

rm -f /tmp/.X11-unix/X0

The only condition for a proper function of the above is that
everyone logs out from Cygwin by typing `exit´ in the black window.
Clicking on the cross in the upper right corner is not enough.
In the case of a crash, the lock can be still removed just by
starting and exiting Cygwin in a standard way (of course done by
the user who owns the lock).

Regards,
Martin

=======================================
Martin Bartak
Czech Technical University in Prague
Dept. of Environmental Engineering 
U-12116, Technicka 4
166 07 Praha 6, Czech Republic 
phone: +420-22435-2486
fax:   +420-22435-5606
e-mail: martin.bartak at fs.cvut.cz




More information about the esp-r mailing list