Skip to content

Only after disaster can we be resurrected

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

  1. [gravitar] Bob Proulx
    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.
  2. [gravitar] Ben Hutchings
    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.
  3. [gravitar] oestrogen
    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.
  4. [gravitar] Steve O
    I'm missing the obquote reference :'(
  5. [gravitar] Steve O
    ... bah, just got it - too subtle!
  6. [author] Steve Kemp

    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!