Re: apache restart

Bryan White <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
David Birnbaum wrote:
> Steffen,
> 
> You're trying to overwrite, and the OS has it locked.  Maybe you can 
> rename it:
> 
>   mv /usr/lib/cgi-bin/test2.fcgi /usr/lib/cgi-bin/test2.fcgi.bak
>   cp test2.fcgi /usr/lib/cgi-bin/test2.fcgi
>   [ kill test2.fcgi process or whatever ]
>   rm /usr/lib/cgi-bin/test2.fcgi.bak
> 
> David.

A strategy I have used that has worked well is to have the application 
keep track of the timestamp on its executable file.  When the time stamp 
changes, exit.

I do the check before handling each request.  It might be better to do 
it after the request, but that might cause problems being sure you are 
running the latest version in a compile and test cycle.

Then to roll out a new version I do:
    mv prog prog.old; mv prog.new prog

The first method has the advantage of being able to undo the change if 
it goes horribly wrong.

This works as well:
    rm prog; mv prog.new prog

This works because Linux maintains a link to the file as long as it is 
executing.  The disk space is not recovered until exit.

This also works beautifully in a gcc compile and test cycle because gcc 
removes the old one before creating the new one.
--
Bryan White
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.