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.
*** This bug has been marked as a duplicate of bug 110556 ***
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.
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.