Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 13904

Summary: virtualx.eclass infinate loop
Product: Gentoo Linux Reporter: J Robert Ray <jrray>
Component: New packagesAssignee: Martin Schlemmer (RETIRED) <azarah>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: 1.4_rc1   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description J Robert Ray 2003-01-14 06:27:09 UTC
while [ ! -f /tmp/.X${XDISPLAY}-lock ]
do
        XDISPLAY=$((${XDISPLAY}+1))
        /usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x32 &>/dev/null &
        sleep 2
done

If Xvfb has a problem that is unrecoverable, this will loop forever.  Consider:

# /usr/X11R6/bin/Xvfb :0 -screen 0 800x600x32
/usr/X11R6/bin/Xvfb: error while loading shared libraries: libpam.so.0: cannot
open shared object file: No such file or directory

The while loop should be clamped to some reasonable high value for ${XDISPLAY}
and should error out if that value is reached.

If the high value is reached, the output from Xvfb should be captured and
displayed to the user in the error message, to give some clue as to what happened.

I'd also recommend giving a starting value for ${XDISPLAY} as a largish number,
and not 0, to lessen the chance of colliding with a used display.
Comment 1 J Robert Ray 2003-01-21 19:48:41 UTC
I committed a fix for this.