Find a free X11 display number

Posted by James on Stack Overflow See other posts from Stack Overflow or by James
Published on 2010-03-26T01:48:01Z Indexed on 2010/03/26 1:53 UTC
Read the original article Hit count: 251

Filed under:

I have some unit tests that need an X11 display so I plan to start Xvfb before running them, but to start Xvfb I will need a free display number to connect it to. My best guess is to see what's free in /tmp/.X11-unix but I'm not sure how to handle the race if many tests try to start simultaneously.

sshd must do this, does anyone know how?

© Stack Overflow or respective owner

Related posts about x11