Martin Bartak wrote: > Hello, > > How to delete </tmp/.X11-unix/X0> automatically when closing > X-session or, > how to prevent its emergence when starting X-sesion or, > how to make it re-writable by 'non-Administrator' user? > > I've got Cygwin 1.5.23-2 (full installation) on WinXP with two > user accounts. I use 'startx' command to invoke X-Win > with default parameters or options. > When starting X-Win, a file named 'X0' is placed into /tmp/.X11-unix/ > and it probably locks the X-server for current user (?) > This file persists after exiting from X-Win and also after exiting > from Cygwin. No problem if I start Cygwin and X-Win again > as the same user, but when I login as another user (different from > Administrator) X-Win cannot be started unless the previous X0 file > is deleted.
I have sshd installed, so I ssh into the account that owns /tmp/.X11 and remove it. Better yet, I simply have the same account starting Xwin all the time. For example, if user1 is the Xwin account and I am logged in as user2, I can ssh into user1 to start Xwin. Or simply do Start->run, then use the runas command to run startxwin.bat as user1 (full program path required). The user2 login session hasn't been interrupted; you just need to "export DISPLAY=:0.0" and then start launching X applications. A problem occurs if user2 doesn't have authentication info to login as user1 or run applications as user1. Maybe there is a way to modify startxwin.bat or startxwin.sh. Have the script wait for the Xwin command to finish, and then have it remove /tmp/.X11. That way, whoever launches Xwin via startxwin.{bat,sh} also removes /tmp/.X11 upon completion. I've only looked at startxwin.bat script for any nontrivial amount of time, and I know that you can have script wait for Xwin to complete by modifying the %RUN% command that launches it. %RUN% is fancy invocation of the "run" command, and getting help on that shows that the -wait switch will cause the script to pause until launched applications ends before continuing. There is a problem I haven't figured out -- how to have startxwin.bat wait for Xwin to finish, yet still proceed to launch xterm *before* it starts to wait. I'm sure those who are wizards in scripting, signals, and things who can figure it out, but that is a foggy area for me at best. I have my eyes peeled for the chimings-in of such experienced people, in case they respond. Meanwhile, you can comment out the xterm line and launch it from another bash shell e.g. opened from the Start Menu (not elegant, I know). -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/