debian/changelog | 8 ++++++++ debian/local/xvfb-run | 29 ++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-)
New commits: commit 44cbb4677c682ab652a35c23447795eba2fef888 Author: Brice Goglin <[EMAIL PROTECTED]> Date: Thu Mar 8 20:34:11 2007 +0100 * Apply patch from [EMAIL PROTECTED] to our xvfb-run wrapper to check whether Xvfb started ok and fix its cleanup (closes: #351042). diff --git a/debian/changelog b/debian/changelog index 21122a9..ae569ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +xorg-server (2:1.2.99.901-2) UNRELEASED; urgency=low + + * Apply patch from [EMAIL PROTECTED] to our xvfb-run wrapper + to check whether Xvfb started ok and fix its cleanup + (closes: #351042). + + -- Brice Goglin <[EMAIL PROTECTED]> Thu, 8 Mar 2007 20:28:35 +0100 + xorg-server (2:1.2.99.901-1) experimental; urgency=low * New upstream release candidate. diff --git a/debian/local/xvfb-run b/debian/local/xvfb-run index a5ff11b..5bbd886 100644 --- a/debian/local/xvfb-run +++ b/debian/local/xvfb-run @@ -81,6 +81,19 @@ find_free_servernum() { echo $i } +# Clean up files +clean_up() { + if [ -e "$AUTHFILE" ]; then + XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >"$ERRORFILE" 2>&1 + fi + if [ -n "$XVFB_RUN_TMPDIR" ]; then + if ! rm -r "$XVFB_RUN_TMPDIR"; then + error "problem while cleaning up temporary directory" + exit 5 + fi + fi +} + # Parse the command line. ARGS=$(getopt --options +ae:f:hn:lp:s:w: \ --long auto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \ @@ -128,6 +141,9 @@ if ! which xauth >/dev/null; then exit 3 fi +# tidy up after ourselves +trap clean_up EXIT + # If the user did not specify an X authorization file to use, set up a temporary # directory to house one. if [ -z "$AUTHFILE" ]; then @@ -147,6 +163,10 @@ XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" 2>&1 & XVFBPID=$! sleep "$STARTWAIT" +if ! kill -0 $XVFBPID 2>/dev/null; then + echo "Xvfb failed to start" >&2 + exit 1 +fi # Start the command and save its exit status. set +e @@ -157,15 +177,6 @@ set -e # Kill Xvfb now that the command has exited. kill $XVFBPID -# Clean up. -XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >"$ERRORFILE" 2>&1 -if [ -n "$XVFB_RUN_TMPDIR" ]; then - if ! rm -r "$XVFB_RUN_TMPDIR"; then - error "problem while cleaning up temporary directory" - exit 5 - fi -fi - # Return the executed command's exit status. exit $RETVAL -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]