Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39730 - Race condition in /etc/init.d/apache2 restart
Summary: Race condition in /etc/init.d/apache2 restart
Status: RESOLVED DUPLICATE of bug 29932
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Web Application Packages Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-28 23:52 UTC by Jaco Kroon
Modified: 2005-07-17 13:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix for apache restart problem (apache2.patch,359 bytes, patch)
2004-01-28 23:54 UTC, Jaco Kroon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2004-01-28 23:52:07 UTC
When you have meny virtual hosts apache can take a while to shut down causing
the restart script to start apache again before apache has properly shut down.
This is almost a non-issue for most people, but alas, there are always those
who would like things to happen correctly.

Reproducible: Sometimes
Steps to Reproduce:
1.  /etc/init.d/apache2 restart
2.
3.

Actual Results:  
It doesn't always actually restart apache, complaining about port 80 being in use.

Expected Results:  
Should have waited for apache to shut down properly and then start apache again

Portage 2.0.49-r20 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r9, 2.6.1)
=================================================================
System uname: 2.6.1 i686 AMD Duron(tm) processor
Gentoo Base System version 1.4.3.10p1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon -Os -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /opt/tomcat/conf /usr/X11R6/lib/X11/xkb
/usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon -Os -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://ftp.up.ac.za/mirrors/gentoo.org/gentoo
ftp://ftp.is.co.za/linux/distributions/gentoo http://gentoo.oregonstate.edu/
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://ftp.up.ac.za/gentoo-portage"
USE="X apm arts avi berkdb cdr crypt cups encode esd foomaticdb gdbm gif gpm gtk
gtk2 imlib java jpeg kde libg++ libwww mad mikmod motif mozilla mpeg mysql
ncurses nls oggvorbis opengl pam pdflib perl png python qt quicktime readline
sdl slang spell ssl svga tcltk tcpd truetype x86 xml2 xmms xv zlib"
Comment 1 Jaco Kroon 2004-01-28 23:54:25 UTC
Created attachment 24581 [details, diff]
fix for apache restart problem

The above should fix it (well, permitting apache doesn't take more than 5
seconds to shut down - I've never seen this).

Also, why are we using start-stop-daemon in the first place when a utility like
apache2ctl already exists to do all this for us?  I mean, in start you can
simply
call apache2ctl start, in stop apache2ctl stop, the same applies to restart and
reload.
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2004-01-29 00:12:07 UTC

*** This bug has been marked as a duplicate of 29932 ***
Comment 3 Jaco Kroon 2004-06-27 23:43:02 UTC
I have seen more than a minute on our web server.  It all depends on system load...