summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Fritsch <sf@debian.org>2008-06-21 10:08:33 +0000
committerStefan Fritsch <sf@sfritsch.de>2012-01-02 10:36:55 +0100
commitb50410fbc30a1900d74b08f7a2e941089ab957ed (patch)
tree1e6038329d29d289c9d086597847de6055ce16d3
parentabb6f3c9ba5531a8173d55c69b863c9e0ebdd922 (diff)
downloadapache2-b50410fbc30a1900d74b08f7a2e941089ab957ed.tar.gz
Make the init script use normal 'stop' instead of 'graceful-stop' again
git-svn-id: svn+ssh://svn.debian.org/svn/pkg-apache/trunk/apache2@702 01b336ce-410b-0410-9a02-a0e7f243c266
-rw-r--r--debian/apache2.2-common.apache2.init50
-rw-r--r--debian/changelog10
2 files changed, 41 insertions, 19 deletions
diff --git a/debian/apache2.2-common.apache2.init b/debian/apache2.2-common.apache2.init
index a2a7ffe0..7ef3f2c5 100644
--- a/debian/apache2.2-common.apache2.init
+++ b/debian/apache2.2-common.apache2.init
@@ -92,7 +92,7 @@ pidof_apache() {
apache_stop() {
if `$APACHE2CTL configtest > /dev/null 2>&1`; then
# if the config is ok than we just stop normaly
- $APACHE2CTL graceful-stop 2>&1 | grep -v 'not running' >&2 || true
+ $APACHE2CTL stop 2>&1 | grep -v 'not running' >&2 || true
else
# if we are here something is broken and we need to try
# to exit as nice and clean as possible
@@ -116,7 +116,34 @@ apache_stop() {
fi
}
-# Stupid hack to keep lintian happy. (Warrk! Stupidhack!).
+apache_wait_stop() {
+ # running ?
+ PIDTMP=$(pidof_apache)
+ if $(kill -0 "${PIDTMP:-}" 2> /dev/null); then
+ PID=$PIDTMP
+ fi
+
+ apache_stop
+
+ # wait until really stopped
+ if [ -n "${PID:-}" ]; then
+ i=0
+ while $(kill -0 "${PID:-}" 2> /dev/null); do
+ if [ $i = '60' ]; then
+ break;
+ else
+ if [ $i = '0' ]; then
+ echo -n " ... waiting "
+ else
+ echo -n "."
+ fi
+ i=$(($i+1))
+ sleep 1
+ fi
+ done
+ fi
+}
+
case $1 in
start)
log_daemon_msg "Starting web server" "apache2"
@@ -138,7 +165,7 @@ case $1 in
else
log_daemon_msg "Stopping web server" "apache2"
fi
- if apache_stop; then
+ if apache_wait_stop; then
log_end_msg 0
else
log_end_msg 1
@@ -168,24 +195,9 @@ case $1 in
log_daemon_msg "Restarting web server" "apache2"
fi
PID=$(pidof_apache) || true
- if ! apache_stop; then
+ if ! apache_wait_stop; then
log_end_msg 1 || true
fi
-
- # Wait until either the parent apache2 process is dead or
- # 4 seconds so that the childs had a chance to close their
- # listening sockets.
- # If 'stop' is used instead of 'graceful-stop', this needs to
- # be increased to at least 12 seconds.
- t=4
- while $(kill -0 "${PID:-}" 2> /dev/null); do
- if [ $t = '0' ]; then
- break
- else
- t=$(($t-1))
- sleep 1
- fi
- done
if $APACHE2CTL start; then
if check_htcacheclean ; then
start_htcacheclean || log_end_msg 1
diff --git a/debian/changelog b/debian/changelog
index fdacc936..aa84af26 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+apache2 (2.2.9-2) UNRELEASED; urgency=low
+
+ * Make the init script use normal 'stop' instead of 'graceful-stop' again:
+ With graceful-stop, it can take a long time until all child processes have
+ closed their listening sockets and there is no way for the init script to
+ know when it is save to start apache again. This could make the restart of
+ apache fail. (Closes: #486629, #463338)
+
+ -- Stefan Fritsch <sf@debian.org> Sat, 21 Jun 2008 00:06:17 +0200
+
apache2 (2.2.9-1) unstable; urgency=low
* New upstream release. Notable changes: