Colm MacCarthaigh wrote:
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.

+1. Ken Coar and I have looked into the need for a 'graceful shutdown' and there may even be a patch posted to the dev list using an IPC (so long ago I don't recall the exact details). Freeing up SIGWINCH sounds like a good solution.

Bill

Reply via email to