debian/changelog | 10 ++++++++++ debian/local/xvfb-run | 23 +++++++++++------------ debian/local/xvfb-run.1 | 9 +-------- 3 files changed, 22 insertions(+), 20 deletions(-)
New commits: commit 91e6b1905dc6943c80929e8c10bb927c2e0f7bab Author: Julien Cristau <jcris...@debian.org> Date: Mon Mar 19 21:51:43 2012 +0100 xvfb-run: drop svn $Id$ keywords And update the comment about necessary build-depends. diff --git a/debian/local/xvfb-run b/debian/local/xvfb-run index ba286a8..8832718 100644 --- a/debian/local/xvfb-run +++ b/debian/local/xvfb-run @@ -1,13 +1,11 @@ #!/bin/sh -# $Id: xvfb-run 2027 2004-11-16 14:54:16Z branden $ - # This script starts an instance of Xvfb, the "fake" X server, runs a command # with that server available, and kills the X server when done. The return # value of the command becomes the return value of this script. # # If anyone is using this to build a Debian package, make sure the package -# Build-Depends on xvfb, xbase-clients, and xfonts-base. +# Build-Depends on xvfb and xauth. set -e diff --git a/debian/local/xvfb-run.1 b/debian/local/xvfb-run.1 index 3973485..4b0353e 100644 --- a/debian/local/xvfb-run.1 +++ b/debian/local/xvfb-run.1 @@ -1,5 +1,3 @@ -.\" $Id: xvfb-run.1 2138 2005-01-17 23:40:27Z branden $ -.\" .\" Copyright 1998-2004 Branden Robinson <bran...@debian.org>. .\" .\" This is free software; you may redistribute it and/or modify commit 48755d15e04c6d8f6d210eba8a81df726a441759 Author: Julien Cristau <jcris...@debian.org> Date: Mon Mar 19 21:50:38 2012 +0100 Speed up xvfb-run Instead of waiting 3 seconds and hoping that's enough for Xvfb to come up (and waiting 2.9 seconds too many in the general case), tell it to send us SIGUSR1 when it's ready to accept connections. This reduces "xvfb-run -- xterm -e true" from 3.17s to 0.28s on a quick test. diff --git a/debian/changelog b/debian/changelog index 890cc6e..5740ae8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ xorg-server (2:1.11.4-2) UNRELEASED; urgency=low * xvfb-run: kill Xvfb when the script dies. + * xvfb-run: instead of waiting 3 seconds and hoping that's enough for Xvfb + to come up (and waiting 2.9 seconds too many in the general case), tell it + to send us SIGUSR1 when it's ready to accept connections. This reduces + "xvfb-run -- xterm -e true" from 3.17s to 0.28s on a quick test. -- Julien Cristau <jcris...@debian.org> Mon, 19 Mar 2012 21:16:07 +0100 diff --git a/debian/local/xvfb-run b/debian/local/xvfb-run index 6733d35..ba286a8 100644 --- a/debian/local/xvfb-run +++ b/debian/local/xvfb-run @@ -15,7 +15,6 @@ PROGNAME=xvfb-run SERVERNUM=99 AUTHFILE= ERRORFILE=/dev/null -STARTWAIT=3 XVFBARGS="-screen 0 640x480x8" LISTENTCP="-nolisten tcp" XAUTHPROTO=. @@ -62,8 +61,6 @@ Options: -s ARGS --server-args=ARGS arguments (other than server number and "-nolisten tcp") to pass to the Xvfb server (default: "$XVFBARGS") --w DELAY --wait=DELAY delay in seconds to wait for Xvfb to start - before running COMMAND (default: $STARTWAIT) EOF } @@ -120,7 +117,7 @@ while :; do -l|--listen-tcp) LISTENTCP="" ;; -p|--xauth-protocol) XAUTHPROTO="$2"; shift ;; -s|--server-args) XVFBARGS="$2"; shift ;; - -w|--wait) STARTWAIT="$2"; shift ;; + -w|--wait) shift ;; --) shift; break ;; *) error "internal error; getopt permitted \"$1\" unexpectedly" exit 6 @@ -163,10 +160,13 @@ while [ $tries -gt 0 ]; do XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1 add :$SERVERNUM $XAUTHPROTO $MCOOKIE EOF - XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" 2>&1 & + # handle SIGUSR1 so Xvfb knows to send a signal when it's ready to accept + # connections + trap : SIGUSR1 + (trap '' SIGUSR1; XAUTHORITY=$AUTHFILE exec Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" 2>&1) & XVFBPID=$! - sleep "$STARTWAIT" + wait if kill -0 $XVFBPID 2>/dev/null; then break elif [ -n "$AUTONUM" ]; then diff --git a/debian/local/xvfb-run.1 b/debian/local/xvfb-run.1 index 17a4292..3973485 100644 --- a/debian/local/xvfb-run.1 +++ b/debian/local/xvfb-run.1 @@ -157,12 +157,7 @@ to achieve the latter function. The default is \(oq\-screen 0 640x480x8\(cq. .TP .BI \-w\ delay \fR,\fB\ \-\-wait= delay -Wait -.I delay -seconds after launching -.B Xvfb -before attempting to start the specified command. -The default is 3. +Ignored for compatibility with earlier versions. .SH ENVIRONMENT .TP .B COLUMNS commit e1da8c8e0b9303fcac26cce1ec427243bdb13db4 Author: Julien Cristau <julien.cris...@logilab.fr> Date: Mon Mar 19 21:17:50 2012 +0100 xvfb-run: kill Xvfb when the script dies. We only killed the Xvfb process if the command exited, not if xvfb-run itself got killed diff --git a/debian/changelog b/debian/changelog index ee4a5a7..890cc6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xorg-server (2:1.11.4-2) UNRELEASED; urgency=low + + * xvfb-run: kill Xvfb when the script dies. + + -- Julien Cristau <jcris...@debian.org> Mon, 19 Mar 2012 21:16:07 +0100 + xorg-server (2:1.11.4-1) unstable; urgency=low * New upstream release. diff --git a/debian/local/xvfb-run b/debian/local/xvfb-run index c48ab37..6733d35 100644 --- a/debian/local/xvfb-run +++ b/debian/local/xvfb-run @@ -92,6 +92,9 @@ clean_up() { exit 5 fi fi + if [ -n "$XVFBPID" ]; then + kill "$XVFBPID" + fi } # Parse the command line. @@ -173,6 +176,7 @@ EOF continue fi error "Xvfb failed to start" >&2 + XVFBPID= exit 1 done @@ -182,9 +186,6 @@ DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1 RETVAL=$? set -e -# Kill Xvfb now that the command has exited. -kill $XVFBPID - # Return the executed command's exit status. exit $RETVAL -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1s9jal-0003b9...@vasks.debian.org