httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <c...@stdlib.net>
Subject [PATCH] graceful restart bug as opportunity
Date Wed, 27 Jul 2005 11:40:58 GMT

configure.in makes a big deal about determining AP_SIG_GRACEFUL, which
defaults to SIGUSR1, but uses SIGWINCH on Linux 2.0. But then
mpm_common.c goes ahead and ignores this for actually sending the
signal, SIGUSR1 is hard-coded;

    if (!strcmp(dash_k_arg, "graceful")) {
        if (!running) {
            printf("httpd not running, trying to start\n");
        }
        else {
            *exit_status = send_signal(otherpid, SIGUSR1);
            return 1;
        }
    }

I can only surmise that there just arn't very many linux 2.0 users who
try to do graceful restarts :-)

Anyway, an easy and obvious fix would be to patch that code to use
AP_SIG_GRACEFUL. However this sucks, so I've attached a totally more
insane patch to just use SIGUSR1 everywhere, and not support "graceful"
on Linux 2,0 (which doesn't work anyway, so it's not exactly a change).

I'm working on adding "graceful stop" (httpd -k drain) [1] and well
there's a shortage of genuinely usable signals. SIGUSR2 would be the
obvious choice, but;

  /*
   * SIGUSR2 is being removed from the mask for the convenience of
   * Purify users (Solaris, HP-UX, SGI) since Purify uses SIGUSR2
   */
  #ifdef SIGUSR2
      sigdelset(sig_mask, SIGUSR2);
  #endif

Which really leaves SIGWINCH as the only semi-reliable signal to use,
but that isn't free because of the stupid Linux 2.0 brokenness. So
rather than seeing this as a lunatic patch, I'm asking you to look into
your hearts and see this as an opportunity to free up a portable signal
so some nifty functionality can be added more easily. 

Failing this, can anyone suggest a non-WINCH signal which is portable
and reliable? Or, how would people feel about ditching kill-style
signalling altogher and using some other IPC mechanism, for more
adaptable and futureproofing ?


[1] When you have a few hundred users downloading DVD ISO's over dialup,
    not killing their downloads when upgrading the webserver would be a 
    real nice feature, and well I'm tired of JoS gloating about it in IIS;	
    http://joelonsoftware.com/items/2005/06/15.html ;)

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Mime
View raw message