httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r240269 - in /httpd/httpd/trunk/server: main.c mpm_common.c
Date Fri, 26 Aug 2005 16:01:03 GMT
Author: colm
Date: Fri Aug 26 09:00:59 2005
New Revision: 240269

URL: http://svn.apache.org/viewcvs?rev=240269&view=rev
Log:

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


Modified:
    httpd/httpd/trunk/server/main.c
    httpd/httpd/trunk/server/mpm_common.c

Modified: httpd/httpd/trunk/server/main.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/main.c?rev=240269&r1=240268&r2=240269&view=diff
==============================================================================
--- httpd/httpd/trunk/server/main.c (original)
+++ httpd/httpd/trunk/server/main.c Fri Aug 26 09:00:59 2005
@@ -318,9 +318,15 @@
                  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);

Modified: httpd/httpd/trunk/server/mpm_common.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/mpm_common.c?rev=240269&r1=240268&r2=240269&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_common.c (original)
+++ httpd/httpd/trunk/server/mpm_common.c Fri Aug 26 09:00:59 2005
@@ -921,6 +921,20 @@
             return 1;
         }
     }
+    
+    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 @@
         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;
                 }



Mime
View raw message