Commit 25da38ba authored by Colm MacCarthaigh's avatar Colm MacCarthaigh
Browse files

Make the neccessary changes to mpm_common and main to support a graceful-stop
command line argument. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240269 13f79535-47bb-0310-9956-ffa450edef68
parent 47b19d81
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -318,9 +318,15 @@ static void usage(process_rec *process)
                 pad);
#endif
#ifdef AP_MPM_WANT_SIGNAL_SERVER
#ifdef AP_MPM_SUPPORTS_GRACEFUL_STOP
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
                 "       %s [-k start|restart|graceful|graceful-stop|stop]",
                 pad);
#else
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
                 "       %s [-k start|restart|graceful|stop]",
                 pad);
#endif /* AP_MPM_SUPPORTS_GRACEFUL_STOP */
#endif
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
                 "       %s [-v] [-V] [-h] [-l] [-L] [-t] [-S]", pad);
+16 −1
Original line number Diff line number Diff line
@@ -922,6 +922,20 @@ int ap_signal_server(int *exit_status, apr_pool_t *pconf)
        }
    }
    
    if (!strcmp(dash_k_arg, "graceful-stop")) {
#ifdef AP_MPM_SUPPORTS_GRACEFUL_STOP
        if (!running) {
            printf("%s\n", status);
        }
        else {
            *exit_status = send_signal(otherpid, AP_SIG_GRACEFUL_STOP);
        }
#else
        printf("httpd MPM \"" MPM_NAME "\" does not support graceful-stop\n");
#endif
        return 1;
    }

    return 0;
}

@@ -949,7 +963,8 @@ void ap_mpm_rewrite_args(process_rec *process)
        case 'k':
            if (!dash_k_arg) {
                if (!strcmp(optarg, "start") || !strcmp(optarg, "stop") ||
                    !strcmp(optarg, "restart") || !strcmp(optarg, "graceful")) {
                    !strcmp(optarg, "restart") || !strcmp(optarg, "graceful") ||
                    !strcmp(optarg, "graceful-stop")) {
                    dash_k_arg = optarg;
                    break;
                }