Only after disaster can we be resurrected

Tuesday, 6 May 2008

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



Comments On This Entry

[gravitar] Bob Proulx

Submitted at 19:19:18 on 6 may 2008

Look to see if the /tmp/.X11-unix/X0 socket has been removed.
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.
[gravitar] Ben Hutchings

Submitted at 22:44:05 on 6 may 2008

Magic cookies go in ~/.Xauthority (and in the server's memory). As Bob suggested, it's probably the socket that's gone. Setting DISPLAY=localhost:0 might work around it as the TCP port will still be accessible.
[gravitar] oestrogen

Submitted at 02:00:37 on 7 may 2008

You're so cute that I can't ever see myself unsubscribe from your feed. :)
Plus, I get some useful tips from times to times.
[gravitar] Steve O

Submitted at 07:33:43 on 7 may 2008

I'm missing the obquote reference :'(
[gravitar] Steve O

Submitted at 07:35:24 on 7 may 2008

... bah, just got it - too subtle!
[author] Steve Kemp

Submitted at 09:04:34 on 7 may 2008

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!


Comments are closed on posts which are more than ten days old.

Recent Posts

Recent Tags