[Groonga-commit] droonga/droonga-engine at a6f05e7 [master] Remove commands to stop service manually

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Sep 24 18:47:03 JST 2014


YUKI Hiroshi	2014-09-24 18:47:03 +0900 (Wed, 24 Sep 2014)

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

  Message:
    Remove commands to stop service manually

  Removed files:
    bin/droonga-engine-status
    bin/droonga-engine-stop

  Deleted: bin/droonga-engine-status (+0 -78) 100755
===================================================================
--- bin/droonga-engine-status    2014-09-24 18:22:36 +0900 (3b4475f)
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Copyright (C) 2014 Droonga Project
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-require "optparse"
-require "sys/proctable"
-
-require "droonga/command/droonga_engine"
-require "droonga/service_installation"
-
-service_installation = Droonga::ServiceInstallation.new
-service_installation.ensure_using_service_base_directory
-
-unless service_installation.have_read_permission?
-  puts("You have no permission to read files under " +
-         "<#{Droonga::Path.base.to_s}>.")
-  puts("Try again with right permission.")
-  exit(false)
-end
-
-configuration = Droonga::Command::DroongaEngine::Configuration.new
-parser = OptionParser.new
-configuration.add_command_line_options(parser)
-parser.parse!(ARGV)
-
-class Failed < StandardError
-  attr_reader :message
-
-  def initialize(message)
-    @message = message
-  end
-end
-
-begin
-  pid_file = configuration.pid_file_path
-  if pid_file.nil?
-    raise Failed.new("Couldn't find the PID file.")
-  end
-
-  unless pid_file.exist?
-    raise Failed.new("There is no PID file at <#{pid_file.to_s}>.")
-  end
-
-  pid = File.read(pid_file).strip
-  unless pid =~ /\A[1-9][0-9]*\z/
-    raise Failed.new("Invalid PID <#{pid}>.")
-  end
-
-  pid = pid.to_i
-  process_info = Sys::ProcTable.ps(pid)
-  unless process_info
-    raise Failed.new("No such process with the PID <#{pid}>.")
-  end
-  unless process_info.cmdline.include?("droonga-engine")
-    raise Failed.new("Not a droonga-engine process: PID <#{pid}> (#{process_info.cmdline})")
-  end
-
-  puts "droonga-engine is running.";
-rescue Failed => error
-  puts "Failed to detect running droonga-engine process."
-  puts error.message
-  exit(false)
-end
-
-exit(true)

  Deleted: bin/droonga-engine-stop (+0 -39) 100755
===================================================================
--- bin/droonga-engine-stop    2014-09-24 18:22:36 +0900 (d3e4a2d)
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Copyright (C) 2014 Droonga Project
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-require "optparse"
-require "sys/proctable"
-
-require "droonga/command/droonga_engine"
-require "droonga/service_installation"
-
-service_installation = Droonga::ServiceInstallation.new
-service_installation.ensure_using_service_base_directory
-
-running = system("droonga-engine-status", *ARGV)
-exit(false) unless running
-
-configuration = Droonga::Command::DroongaEngine::Configuration.new
-parser = OptionParser.new
-configuration.add_command_line_options(parser)
-parser.parse!(ARGV)
-
-pid_file = configuration.pid_file_path
-pid = File.read(pid_file).strip
-puts "Sending SIGTERM to the process...";
-Process.kill(:TERM, pid.to_i)
-exit(true)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index