[Groonga-commit] droonga/droonga-engine at ce1a8d0 [buffered-forward] sample cluster: support droonga-engine restart

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Mon Jan 5 19:07:29 JST 2015


Kouhei Sutou	2015-01-05 19:07:29 +0900 (Mon, 05 Jan 2015)

  New Revision: ce1a8d055da918d3a00dccc1ec31f3ae26861140
  https://github.com/droonga/droonga-engine/commit/ce1a8d055da918d3a00dccc1ec31f3ae26861140

  Message:
    sample cluster: support droonga-engine restart

  Modified files:
    sample/cluster/Rakefile

  Modified: sample/cluster/Rakefile (+13 -1)
===================================================================
--- sample/cluster/Rakefile    2015-01-05 19:04:32 +0900 (7fddb9d)
+++ sample/cluster/Rakefile    2015-01-05 19:07:29 +0900 (b99ed1d)
@@ -62,6 +62,10 @@ class DroongaEngine
     Process.kill(:TERM, @pid)
     Process.waitpid(@pid)
     @pid = nil
+    if pid_path.exist?
+      pid = Integer(pid_path.read)
+      Process.kill(:TERM, pid)
+    end
   end
 
   def host
@@ -81,6 +85,14 @@ class DroongaEngine
     working_dir_path + "droonga-engine.pid"
   end
 
+  def pid_path_base_name
+    "droonga-engine.pid"
+  end
+
+  def pid_path
+    working_dir_path + pid_path_base_name
+  end
+
   def generate_catalog(node_ids)
     hosts = node_ids.collect do |node_id|
       self.class.host(node_id)
@@ -98,7 +110,7 @@ class DroongaEngine
       "port"      => self.class.port,
       # "log_file"  => "droonga-engine.log",
       "log_level" => "info",
-      "pid_file"  => "droonga-engine.pid",
+      "pid_file"  => pid_path_base_name,
     }
     config_path.open("w") do |file|
       file.puts(config.to_yaml)
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る