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

Bug#350119: eliminate grep error message



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Package: apache2-common
Version: 2.0.55-4
Severity: minor

Hi,

You might as well eliminate the grep error message. This comes when
there is no config file found in /etc/apach2/conf.d directory. The error
message is displayed on console or normal output when I stop apache2:

# /etc/init.d/apache2 stop
Stopping apache 2.0 web server...grep: /etc/apache2/conf.d/[^.#]*: No
such file or directory
.

Here is a simple patch with modifies the script to feed PIDFILE variable
content (which uses grep command) only when the config file actually
exists, checking the i variable. (Patch attached.)

$ diff /etc/init.d/apache2 /etc/init.d/apache2.new
40c40,42
< 		PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print $2}'`
- ---
> 		if [ -f "$i" ]; then
> 			PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print $2}'`
> 		fi

- -- System Information --
Debian Release: testing/unstable
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: 2.6.15-1-686
C library version: 2.3.6-3
Locale: LANG=en_US.UTF-8, LC_CTYPE=hu_HU.UTF-8 libc6 (>= 2.3.5-1),

Versions of packages apache2-common depends on:
libdb4.3 (>= 4.3.28-1), libexpat1 (>= 1.95.8), debconf,
debianutils (>= 1.6), mime-support, openssl, net-tools,
ssl-cert (>= 1.0-7), libmagic1, libgcc1 (>= 1:3.3.5),
apache2-utils (= 2.0.55-4), lsb-base (>= 2.0)


BR,
Miklos

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFELZ61BVP7q1vdH4sRAg03AKDT5R6MPY7PBsqqeo/SKccgaHaNMgCfWkH+
Ks2viAmPxn45AKQiOph+pK0=
=ZRKO
-----END PGP SIGNATURE-----
40c40,42
< 		PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print $2}'`
---
> 		if [ -f "$i" ]; then
> 			PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print $2}'`
> 		fi


Reply to: