I leave my main desktop logged in for months a time; as demonstrated by my previous bug with the keyboard transition for xorg.
The screen is setup to lock after 5 minutes of idle, so there's no real security issue, and it is extremely convenient.
Every few weeks though my desktop gets into a funny state where no new windows may be opened.. Existing applications continue running without any problems, but no new windows/shells/whatever may be opened.
Tonight it happened again.
And the lightbulb went on in my head: My flat uses CFEngine to manage itself. (Two physical servers here, with 5-10 Xen guests, and a number of remote servers.)
One of the things that CFengine is configued to do is to tidy directories of files which are older than 30 days. Including /tmp.
So that explains that.
Every month the magic cookie in $TMP would be nuked, and X would disallow new connections.
I guess the next time this happens I should look at using Xauth to fix the issue, but generally I just logout, make coffee, smoke a cigarette, and login again.
In conclusion: I'm a stupid-head.
ObQuote: Fight Club
Instead of using a custom rule in cfengine you might consider using tmpreaper for this instead since X11 sockets are not the only problem cases.
Plus, I get some useful tips from times to times.
Hmm I guess you're all right; it is the socket that has gone, not the Xauth file itself. I guess I didn't think that through carefully enough.
Thanks for the tip though Bob & Ben. If I get into a similar state in the future I will definitely remember to try the explicit exporting of DISPLAY - I always have at least one shell open!
Oestrogen: Hahah!