Bug#280527: apache2-common: grep + set -e = exit 1
Package: apache2-common
Version: 2.0.52-2
Severity: grave
Tags: patch
Setting up apache2-common (2.0.52-2) ...
+ '[' configure '!=' configure ']'
+ NETSTAT=/bin/netstat
+ '[' '!' -f /etc/apache2/ports.conf ']'
+ echo '# 0 = start on boot; 1 = don'\''t start on boot'
++ /bin/netstat -lnt
++ grep 'no support for .AF INET (tcp)'
+ NO_AF_INET=
dpkg: error processing apache2-common (--configure):
subprocess post-installation script returned error exit status 1
I quote:
NO_AF_INET=`$NETSTAT -lnt 2>&1 | grep 'no support for .AF INET(tcp)'`
NO_PORT_80=`$NETSTAT -lnt | awk '{print $4}' | grep ':80$'`
This causes the postinst to fail if either of the greps exits 1.
(see #276722 for an identical bug against discover1.)
A possible patch is attached.
Thanks,
Josh
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable'), (499, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.9-bk7
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Versions of packages apache2-common depends on:
ii debconf 1.4.40 Debian configuration management sy
ii debianutils 2.10.3 Miscellaneous utilities specific t
ii libapr0 2.0.52-2 The Apache Portable Runtime
ii libc6 2.3.2.ds1-18 GNU C Library: Shared libraries an
ii libdb4.2 4.2.52-17 Berkeley v4.2 Database Libraries [
ii libexpat1 1.95.8-1 XML parsing C library - runtime li
ii libldap2 2.1.30-3 OpenLDAP libraries
ii libmagic1 4.10-3 File type determination library us
ii libssl0.9.7 0.9.7d-5 SSL shared libraries
ii mime-support 3.28-1 MIME files 'mime.types' & 'mailcap
ii net-tools 1.60-10 The NET-3 networking toolkit
ii openssl 0.9.7d-5 Secure Socket Layer (SSL) binary a
pn ssl-cert Not found.
ii zlib1g 1:1.2.2-3 compression library - runtime
--- apache2-2.0.52/debian/apache2-common.postinst 2004-11-09 16:22:37.000000000 -0800
+++ apache2-common.postinst 2004-11-09 16:34:45.000000000 -0800
@@ -13,8 +13,12 @@
#This desperately needs debconf, soon.
if [ ! -f /etc/apache2/ports.conf ]; then
echo "# 0 = start on boot; 1 = don't start on boot" > /etc/default/apache2
- NO_AF_INET=`$NETSTAT -lnt 2>&1 | grep 'no support for .AF INET (tcp)'`
- NO_PORT_80=`$NETSTAT -lnt | awk '{print $4}' | grep ':80$'`
+ if $NETSTAT -lnt 2>&1 | grep -q 'no support for .AF INET (tcp)'; then
+ NO_AF_INET=1
+ fi
+ if $NETSTAT -lnt | awk '{print $4}' | grep -q ':80$'; then
+ NO_PORT_80=1
+ fi
if [ -n "$NO_AF_INET" -o -n "$NO_PORT_80" ]; then
echo "NO_START=1" >> /etc/default/apache2
echo "Listen 80" >> /etc/apache2/ports.conf
Reply to: