YUKI Hiroshi
null+****@clear*****
Fri Jul 18 17:21:40 JST 2014
YUKI Hiroshi 2014-07-18 17:21:40 +0900 (Fri, 18 Jul 2014) New Revision: c2d140cf91e735dc4636ab3a1111eaf8ff5ca6fb https://github.com/droonga/droonga-engine/commit/c2d140cf91e735dc4636ab3a1111eaf8ff5ca6fb Message: Save PID file for data publisher correctly Modified files: bin/droonga-engine-data-publisher lib/droonga/command/serf_event_handler.rb Modified: bin/droonga-engine-data-publisher (+0 -3) =================================================================== --- bin/droonga-engine-data-publisher 2014-07-18 10:23:38 +0900 (303d3fc) +++ bin/droonga-engine-data-publisher 2014-07-18 17:21:40 +0900 (38d270d) @@ -54,9 +54,6 @@ published_dir = Droonga::Path.published(options.port) FileUtils.mkdir_p(published_dir.to_s) published_file = Pathname(options.published_file).expand_path FileUtils.copy(published_file.to_s, published_dir + published_file.basename) -File.open(published_dir + ".pid", "w") do |file| - file.puts(Process.pid) -end server = HTTPServer.new(:Port => options.port, :DocumentRoot => published_dir, Modified: lib/droonga/command/serf_event_handler.rb (+8 -1) =================================================================== --- lib/droonga/command/serf_event_handler.rb 2014-07-18 10:23:38 +0900 (f3f5a78) +++ lib/droonga/command/serf_event_handler.rb 2014-07-18 17:21:40 +0900 (5b6a64d) @@ -188,7 +188,14 @@ module Droonga "--port", port.to_s, "--published-file", Path.catalog.to_s ] - spawn(env, *publisher_command_line) + pid = spawn(env, *publisher_command_line) + + published_dir = Path.published(port) + pid_file = published_dir + ".pid" + + File.open(pid_file, "w") do |file| + file.puts(pid) + end end def unpublish_catalog -------------- next part -------------- HTML����������������������������... 下載