Re: mod_perl restart vs. graceful
[snip] we could change the script to do a stop then restart, but we've seen where this method (done manually) was not 100% reliable and would sometimes require a couple of stops before we could really restart apache (never understood why this was so.) It's most likely that the stop is actually taking longer than you expect to process. Apachectl just sends the kill and doesn't wait around for everything to exit. Depending on what each of the children is doing, this can take awhile. So the better approach is not to stop again but, if start fails, wait a few seconds and try the start again. Better yet, probe for the existance of the httpd.pid file. That's basically the last thing Apache does when shutting down (unlinking it, that is). Issac
Re: mod_perl restart vs. graceful
* Dan Wilga [EMAIL PROTECTED] [2002-04-09 10:19]: It's most likely that the stop is actually taking longer than you expect to process. Apachectl just sends the kill and doesn't wait around for everything to exit. Depending on what each of the children is doing, this can take awhile. So the better approach is not to stop again but, if start fails, wait a few seconds and try the start again. For exactly this reason, I always modify apachectl so that the restart option looks like: restart) timeout=${2:-5} count=0 $0 stop while [ $count -lt $timeout ]; do echo -n . sleep 1 count=`expr $count + 1` done echo $0 start ;; This will sleep for $2 (or 5 seconds) between stopping and starting. The sleep ensures that the start doesn't get called too quickly. Use it like: apachectl restart 10 to wait 10 seconds, or apachectl restart to wait the default 5. (darren) -- Fanaticism consists in redoubling your efforts when you have forgotten your aim. -- George Santayana
Re: mod_perl restart vs. graceful
Hi Darren, See my suggested refinement below (I don't like to leave the server down any longer than needed...8^): On Tue, 9 Apr 2002, darren chamberlain wrote: For exactly this reason, I always modify apachectl so that the restart option looks like: restart) timeout=${2:-5} count=0 $0 stop while [ $count -lt $timeout ]; do while [ -f $PIDFILE -a $count -lt $timeout ]; do echo -n . sleep 1 count=`expr $count + 1` done echo $0 start ;; This will sleep for $2 (or 5 seconds) between stopping and starting. The sleep ensures that the start doesn't get called too quickly. Steve -- Steve Reppucci [EMAIL PROTECTED] | Logical Choice Software http://logsoft.com/ | =-=-=-=-=-=-=-=-=-=- My God! What have I done? -=-=-=-=-=-=-=-=-=-=
Re: mod_perl restart vs. graceful
Stephen Reppucci wrote: Hi Darren, See my suggested refinement below (I don't like to leave the server down any longer than needed...8^): On Tue, 9 Apr 2002, darren chamberlain wrote: For exactly this reason, I always modify apachectl so that the restart option looks like: restart) timeout=${2:-5} count=0 $0 stop while [ $count -lt $timeout ]; do while [ -f $PIDFILE -a $count -lt $timeout ]; do echo -n . sleep 1 count=`expr $count + 1` done echo $0 start ;; This will sleep for $2 (or 5 seconds) between stopping and starting. The sleep ensures that the start doesn't get called too quickly. On Debian, if you use the /etc/init.d/apache[-perl] script for restarting, it uses the start-stop-daemon program to do essentially the same thing. (Another reason I like Debian :-).
mod_perl restart vs. graceful
i'm interested in understanding the consequences of restart vs. graceful better. i've seen where the mod_perl guides recommend stopping and then restarting a mod_perl apache rather than doing a graceful restart. i only saw indications that memory does not get cleaned up cleanly if this is done. my operations group does graceful restarts for the sole purpose of rotating logs. their method has the beauty that apache continues to run after the graceful (very important when automated jobs are playing with your website at midnight when no employee is watching the system.) we could change the script to do a stop then restart, but we've seen where this method (done manually) was not 100% reliable and would sometimes require a couple of stops before we could really restart apache (never understood why this was so.) if there is sufficient reason to move to a hard stop/restart, then i suppose we could make the job retry like 5 times and then email a pager if there continues to be a problem. i just need ammunition if i am to jeapordize my operations group's sleep for yet another reason. can anyone elaborate? thank you, jlg John Leon Guerrero -- http://www.live365.com