Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92105 - apache-1.3 init script restart problem
Summary: apache-1.3 init script restart problem
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard: 1.3
Keywords:
: 118563 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-10 05:49 UTC by Eric Brown
Modified: 2006-06-05 05:06 UTC (History)
1 user (show)

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


Attachments
Initscript for apache that actually restarts apache (a,1.21 KB, text/plain)
2005-07-14 01:53 UTC, Ole Tange
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Brown 2005-05-10 05:49:47 UTC
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.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-05-10 06:13:28 UTC
Where X should be what? Not a solution. 
Comment 2 Ole Tange 2005-07-14 01:52:02 UTC
I have solved this by doing sleep 1 until apache is no longer in ps.

I have attached my init-script.
Comment 3 Ole Tange 2005-07-14 01:53:53 UTC
Created attachment 63373 [details]
Initscript for apache that actually restarts apache
Comment 4 Eric Brown 2005-08-07 17:41:35 UTC
I heard baselayout will soon perform some kind of checks/sleeps...
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2006-01-10 11:40:19 UTC
*** Bug 118563 has been marked as a duplicate of this bug. ***
Comment 6 Sven 2006-01-10 11:56:49 UTC
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.
Comment 7 Sven 2006-02-05 09:36:08 UTC
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.
Comment 8 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-02-05 13:24:12 UTC
(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.
Comment 9 Sven 2006-02-05 14:37:45 UTC
Where can i read more about those "checks" that baselayout will perform?
Comment 10 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-02-05 19:21:23 UTC
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
Comment 11 Benedikt Böhm (RETIRED) gentoo-dev 2006-06-05 05:06:44 UTC
this has been in svn forever and should be fixed in at least 1.3.34-r10 ..