I run apache-1.3.33-r1 and when I do /etc/init.d/apache restart, it says: * Stopping apache... [ ok ] * Starting apache... [ ok ] When I look for a funning apache process there isn't one. I know we can't check the return value in apache-1.3, but I think this problem is caused by not giving it enough time to fully stop before it starts up again (I say this because I have only seen this problem since I started using a mod_perl script). Any chance of getting a sleep X into the script? Reproducible: Always Steps to Reproduce: 1. 2. 3.
Where X should be what? Not a solution.
I have solved this by doing sleep 1 until apache is no longer in ps. I have attached my init-script.
Created attachment 63373 [details] Initscript for apache that actually restarts apache
I heard baselayout will soon perform some kind of checks/sleeps...
*** Bug 118563 has been marked as a duplicate of this bug. ***
My comment from Bug 118563: Apache's init.d-script should better wait for apache's "master"-process to terminate. I think the init.d-script can use start-stop-daemon in combination with the PID-file. start-stop-daemon supports waiting for terminating by using something like "--retry 10", i think.
Based on my last comment, do the following: Replace the line ${APACHE2} ${APACHE2_OPTS} -k stop in /etc/init.d/apache2 by start-stop-daemon --stop --pidfile /var/run/apache2.pid --retry 300 Apache gets SIGTERM like it used to and start-stop-daemon waits 300 seconds for apache to terminate. Very simple sollution and i don't see, why this is not in portage yet ;-) I'd like a comment at least, why this is a good or a not so good idea. Sleeps are a bad idea IMHO, cause nobody knows how long it will take apache to terminate.
(In reply to comment #4) > I heard baselayout will soon perform some kind of checks/sleeps... > This is correct. We are looking to see whether the checks baselayout does will work for us - from what I've read, they will. I haven't had a chance to look into this fully though.
Where can i read more about those "checks" that baselayout will perform?
The information I read was on uberlord's blog at http://roy.marples.name/, though you can also find information in the baselayout sourcecode itself, particularily the ChangeLog at http://sources.gentoo.org/viewcvs.py/*checkout*/baselayout/trunk/ChangeLog as well as an announcement in the GWN at http://www.gentoo.org/news/en/gwn/20060116-newsletter.xml
this has been in svn forever and should be fixed in at least 1.3.34-r10 ..