I'm learning something about X11. And I was wondering what would happen if I'd deleted the directory "/tmp/.X11-unix". I tried it but actually, nothing special happened. Every GUI app runs unaffected. Why ?
I thought X client communicated with X server through unix domain socket, and the socket pathname is "/tmp/.X11-unix/X0".
My os is Ubuntu 14.04.
Any help will be appreciated.
The X server creates the directory and opens the socket in that directory. Clients do not open the socket directly but use the
connect
function (which does reference the path of the socket device). The socket continues to exist as long as the X server process has it open. The clue is in this wording from theconnect
manual page:That is, the address given in the
connect
call is not necessarily a filesystem path that applications can test by other means but is simply something known to the kernel when applications ask to open the socket.