[Groonga-commit] groonga/groonga [master] httpd: support /d/shutdown if master_process is off

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 22日 (金) 17:52:48 JST


Ryo Onodera	2012-06-22 17:52:48 +0900 (Fri, 22 Jun 2012)

  New Revision: 6bde2e85cbeae7e8a89829d4ff4a1deb22cd4899
  https://github.com/groonga/groonga/commit/6bde2e85cbeae7e8a89829d4ff4a1deb22cd4899

  Log:
    httpd: support /d/shutdown if master_process is off

  Modified files:
    src/nginx-module/ngx_http_groonga_module.c

  Modified: src/nginx-module/ngx_http_groonga_module.c (+9 -1)
===================================================================
--- src/nginx-module/ngx_http_groonga_module.c    2012-06-22 17:39:06 +0900 (6dadbbb)
+++ src/nginx-module/ngx_http_groonga_module.c    2012-06-22 17:52:48 +0900 (de446d0)
@@ -142,9 +142,17 @@ ngx_http_groonga_context_receive_handler(grn_ctx *context,
 
     if (flags == GRN_CTX_QUIT) {
       ngx_int_t ngx_rc;
+      ngx_int_t ngx_pid;
+
+      if (ngx_process == NGX_PROCESS_SINGLE) {
+        ngx_pid = getpid();
+      } else {
+        ngx_pid = getppid();
+      }
+
       ngx_rc = ngx_os_signal_process((ngx_cycle_t*)ngx_cycle,
                                      "stop",
-                                     getppid());
+                                     ngx_pid);
       if (ngx_rc == NGX_OK) {
         context->stat &= ~GRN_CTX_QUIT;
         grn_ctx_recv(context, &result, &result_size, &flags);
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index