On Aug 25, 2005, at 6:01 AM, Colm MacCarthaigh wrote:


Now that the ap_close_listeners() code is committed, implementing a
graceful stop is relatively trivial, I already have it working here for me. However there are some complicated nits which I thought I'd solicit
feedback on.

One of the main benefits of a graceful stop is to allow for upgrading
httpd without kicking off long downloads. For this situation, it's
desirable that it be possible to do;

    make install
    apachectl graceful-stop
    apachectl start

and have it work as the admin would expect, but this leads to some
complications. Files like the ScriptSock, ScoreBoardFile,
SSLSessionCache, LockFile, LDAPSharedCacheFile and so on will get
clobbered. Ther will be two instances of httpd, pointing at the same
files.

To solve this, I'd like allow the administrator do something like;

    ScoreBoardFile    /var/run/apache_status-%p
    ScriptSock    cgi_sock.%p
    SSLSessionCache shm:/path/to/datafile.%p

where %p is the PID of the server. Or even better I'd like to be able to
do;

    # Create a directory for server-related state, gets
    # removed on server exit.
    StateDirectory    %p.state/

    ScoreBoardFile    $statedir/apache_status
    ScriptSock    $statedir/cgi_sock
    SSLSessionCache shm:$statedir/datafile

But either way, it starts to look like an embedded macro engine, and
it's not at all clear to admin that they can't use those expansions
elsewhere. This is a mean problem.

What's really needed is a lightweight embedded scripting engine for
config parsing, but that's a lot of overkill for simply making graceful
stops working.

Has anyone got any comments on any other approaches? or on the
suitability of adding a small ammount of expansion to the state- related
directives above?


Although StateDirectory is nice, I think it would
complicate things. Instead, the '%p' idea is cleaner;
Of course, it's been proposed before that all server-specific
files and resources that are clobberable are internally
prepended-appended with PID, as we already do with some. That,
I think, would be the best solution.

Reply via email to