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

Bug#298836: apachectl: remaining temporary directories with long status page



Package: apache
Version: 1.3.26-0woody6.cril0
Severity: minor
Tags: patch

Hi,

with a long status page, such as 15 kilobytes, the result of starting

   /usr/sbin/apachectl status

is that spurious (empty) temporary directories remain in /tmp.

The problem is because apachectl status starts lynx -dump, which creates
and normally removes a temporary directory. However, when there is much
data sent by lynx to stdout to a pipe to apachectl, the current
apachectl implementation breaks the pipe in the middle, killing lynx.

Here is a work-around to ignore spurious lynx data instead of abruptly
closing the pipe:

--- /usr/sbin/apachectl.ORIG    Thu Mar 10 10:29:35 2005
+++ /usr/sbin/apachectl Thu Mar 10 10:32:19 2005
@@ -136,7 +136,18 @@
        fi
        ;;
     status)
-       $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
+        # Work-around for lynx killed because of broken pipe; doesn't
+       # remove the /tmp/...... (6 chars) directory.
+       $LYNX $STATUSURL | awk 'BEGIN { has_finished = 0; }
+                               /process$/ { if (!has_finished) {
+                                               print;
+                                               has_finished = 1;
+                                            }
+                                          }
+                               { if (!has_finished) {
+                                     print;
+                                 }
+                               } '
        ;;
     fullstatus)
        $LYNX $STATUSURL

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux defian 2.4.21 #1 Tue Apr 20 15:30:51 MEST 2004 i686
Locale: LANG=C, LC_CTYPE=fr_CH

Versions of packages apache depends on:
ii  apache-common       1.3.26-0woody6.cril0 Support files for all Apache webse
ii  dpkg                1.9.21               Package maintenance system for Deb
ii  libc6               2.2.5-11.8           GNU C Library: Shared libraries an
ii  libdb2              2:2.7.7.0-7          The Berkeley database routines (ru
ii  libexpat1           1.95.2-6             XML parsing C library - runtime li
ii  logrotate           3.5.9-8              Log rotation utility
ii  mime-support        3.18-1.3             MIME files 'mime.types' & 'mailcap
ii  perl                5.6.1-8.8            Larry Wall's Practical Extraction 
ii  perl [perl5]        5.6.1-8.8            Larry Wall's Practical Extraction 




Reply to: