Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 206730 - www-servers/apache - apache2 restart doesn't wait for process to end
Summary: www-servers/apache - apache2 restart doesn't wait for process to end
Status: RESOLVED DUPLICATE of bug 110556
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-20 02:33 UTC by Paul Taylor
Modified: 2008-01-21 10:24 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Taylor 2008-01-20 02:33:58 UTC
After upgrading www-servers/apache, a full restart is required (vs. a reload or graceful restart) to run the new version.  The init script attempts to start Apache before the existing process has ended:  

# /etc/init.d/apache2 restart
 * Caching service dependencies ...                                      [ ok ]
 * Stopping apache2 ...                                                  [ ok ]
 * Starting apache2 ...
httpd (pid 6131) already running                                         [ ok ]
# /etc/init.d/apache2 stop
 * Stopping apache2 ...
httpd (no pid file) not running                                          [ ok ]

I tried inserting a "sleep 1" in the stop() routine as per other init scripts, but that doesn't seem to be long enough; checking for the pid file to be removed before restarting would solve the problem in all cases.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-01-20 09:16:14 UTC

*** This bug has been marked as a duplicate of bug 110556 ***
Comment 2 Kai Krakow 2008-01-21 10:21:46 UTC
I don't think this is a duplicate of #110556. After my original bug report was fixed in apache-2.0 it reappeared in apache-2.2.

start-stop-daemon just doesn't wait long enough for all apache processes to shut down. Using multithreaded worker mpm can really take a while for all child processes to shut down.

So either the script should check if all PIDs have ended and after a timeout send another (possibly stronger) signal or start-stop-daemon should be patches to properly watch the process and do the timeout stuff.

From what I saw in the man page:

> -R|--retry timeout|schedule
>        With --stop, specifies that start-stop-daemon is to check whether the
>        process(es)  do  finish.   It  will  check repeatedly whether any
>        matching processes are running, until none are.  If the processes do
>        not exit it will then take further action as determined by the
>        schedule.

the -R parameter should be responsible for that. But patching the init.d file seems to have absolutely no effect. It seems the parameter is totally ignored.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2008-01-21 10:24:07 UTC
As noted on the other bug; apache should not report that it's stopped until all children processes have actually stopped. We are NOT going to insert any sleep hacks into the script. If you want this fixed properly, take this w/ apache upstream.