[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#626501: xvfb-run leaves Xvfb running when killed



Package: xvfb
Version: 2:1.4.2-10.lenny3
Severity: normal


It looks like the xvfb-run script doesn't properly kill the Xvfb process
when you kill it. We should properly send a kill to $XVFBPID.

You can easily reproduce this bug by running:

	xvfb-run -a sleep 1000

And in a different terminal, run killall xvfb-run. This will leave a
stale process.

Proposed patch:

%%%
--- xvfb-run
+++ xvfb-run
@@ -17,6 +17,7 @@
 ERRORFILE=/dev/null
 STARTWAIT=3
 XVFBARGS="-screen 0 640x480x8"
+XVFBPID=
 LISTENTCP="-nolisten tcp"
 XAUTHPROTO=.
 
@@ -83,6 +84,10 @@
 
 # Clean up files
 clean_up() {
+    if [ ! -z "$XVFBPID" ]; then
+        kill $XVFBPID
+    fi
+
     if [ -e "$AUTHFILE" ]; then
         XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >>"$ERRORFILE" 2>&1
     fi
@@ -175,9 +180,6 @@
 RETVAL=$?
 set -e
 
-# Kill Xvfb now that the command has exited.
-kill $XVFBPID
-
 # Return the executed command's exit status.
 exit $RETVAL
 
%%%

-- System Information:
Debian Release: 5.0.8
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-bpo.5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages xvfb depends on:
ii  libc6                     2.7-18lenny7   GNU C Library: Shared libraries
ii  libdbus-1-3               1.2.1-5+lenny2 simple interprocess messaging syst
ii  libfontenc1               1:1.0.4-3      X11 font encoding library
ii  libhal1                   0.5.11-8       Hardware Abstraction Layer - share
ii  libpixman-1-0             0.10.0-2       pixel-manipulation library for X a
ii  libxau6                   1:1.0.3-3      X11 authorisation library
ii  libxdmcp6                 1:1.0.2-3      X11 Display Manager Control Protoc
ii  libxfont1                 1:1.3.3-1      X11 font rasterisation library
ii  x11-common                1:7.3+20       X Window System (X.Org) infrastruc

Versions of packages xvfb recommends:
pn  xbase-clients                 <none>     (no description available)
ii  xfonts-base                   1:1.0.0-5  standard fonts for X

xvfb suggests no packages.

-- no debconf information



Reply to: