summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorBrice Goglin <Brice.Goglin@ens-lyon.org>2007-03-08 20:34:11 +0100
committerDrew Parsons <dparsons@debian.org>2007-03-10 23:37:42 +1100
commit5cbab1b34dc2bbc1d54dd3c379fc5cf8262487b3 (patch)
tree852ac22b20af41657e135bc528f50ab87492b25f /debian
parentf0a5786ea1fc62d4ab7611ea495c156fe012132c (diff)
* Apply patch from adrian@smop.co.uk to our xvfb-run wrapper
to check whether Xvfb started ok and fix its cleanup (closes: #351042).
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog8
-rw-r--r--debian/local/xvfb-run29
2 files changed, 27 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog
index 5da12c97a..b2ba57408 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
xorg-server (2:1.2.99.901-2) UNRELEASED; urgency=low
+ [ Drew Parsons ]
* Bring xprint back into the xorg fold.
- include existing patches:
- 91_ttf2pt1 allows Xprint to use ttf2pt1 for Type1 font handling
@@ -17,7 +18,12 @@ xorg-server (2:1.2.99.901-2) UNRELEASED; urgency=low
x11proto-print-dev
* Run autoreconf to update changes to hw/xprint/ps/Makefile.am.
- -- Drew Parsons <dparsons@debian.org> Sat, 10 Mar 2007 03:18:22 +1100
+ [ Brice Goglin ]
+ * Apply patch from adrian@smop.co.uk to our xvfb-run wrapper
+ to check whether Xvfb started ok and fix its cleanup
+ (closes: #351042).
+
+ -- Drew Parsons <dparsons@debian.org> Sat, 10 Mar 2007 23:31:52 +1100
xorg-server (2:1.2.99.901-1) experimental; urgency=low
diff --git a/debian/local/xvfb-run b/debian/local/xvfb-run
index a5ff11b00..5bbd88613 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" $XVFBARGS $LISTENTCP >"$ERRORFILE" \
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