Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Bug#445946: [apache2.2-common] /etc/init.d/apache2 restart gives an error when /bin/sh points to dash

From: <bugtracker(at)slideomania.com>
Date: Tue Oct 09 2007 - 05:45:03 EDT


Package: apache2.2-common
Version: 2.2.3-4+etch1
Severity: minor
Tags: patch

When /bin/sh points to dash, invoking

# /etc/init.d/apache2 restart

gives the following error:

Forcing reload of web server (apache2).../etc/init.d/apache2: 172: [[: not found
/etc/init.d/apache2: 172: [[: not found
..

When /bin/sh points to bash, the above command works without any error message.

Below is a diff between Debian's supplied file and my supposed changes. If applied, the script works without error output if /bin/sh points to dash.

# diff -U 3 /etc/init.d/apache2 /tmp/apache2

  • /etc/init.d/apache2 2007-06-17 22:12:56.000000000 +0200 +++ /tmp/apache2 2007-10-09 11:00:42.000000000 +0200 @@ -102,10 +102,10 @@ if [ -n "${PID:-}" ]; then i=0 while $(kill -0 "${PID:-}" 2> /dev/null); do - if [[ $i == '30' ]]; then + if [ "$i" = '30' ]; then break; else - if [[ $i == '0' ]]; then + if [ "$i" = '0' ]; then echo -n " waiting " else echo -n "."
Do you need help?X

# diff -C 3 /etc/init.d/apache2 /tmp/apache2

  • /etc/init.d/apache2 2007-06-17 22:12:56.000000000 +0200 --- /tmp/apache2 2007-10-09 11:00:42.000000000 +0200
  • 102,111 **** if [ -n "${PID:-}" ]; then i=0 while $(kill -0 "${PID:-}" 2> /dev/null); do ! if [[ $i == '30' ]]; then break; else ! if [[ $i == '0' ]]; then echo -n " waiting " else echo -n "." --- 102,111 ---- if [ -n "${PID:-}" ]; then i=0 while $(kill -0 "${PID:-}" 2> /dev/null); do ! if [ "$i" = '30' ]; then break; else ! if [ "$i" = '0' ]; then echo -n " waiting " else echo -n "."
-- 
To UNSUBSCRIBE, email to debian-apache-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Received on Tue Oct 9 05:51:53 2007

This archive was generated by hypermail 2.1.8 : Wed Mar 19 2008 - 02:58:19 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library