From a4ca91faae64d8f61f5b19cd63279ec139fe61fa Mon Sep 17 00:00:00 2001 From: Sidney Burks Date: Mon, 20 Jun 2011 02:42:03 +0200 Subject: [PATCH] kill -INT not kiling process on linux. switched to kill -KILL --- lib/guard/rails/runner.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/guard/rails/runner.rb b/lib/guard/rails/runner.rb index 1a9a37c..630c898 100644 --- a/lib/guard/rails/runner.rb +++ b/lib/guard/rails/runner.rb @@ -21,7 +21,7 @@ module Guard def stop if File.file?(pid_file) - system %{kill -INT #{File.read(pid_file).strip}} + system %{kill -KILL #{File.read(pid_file).strip}} end end @@ -69,7 +69,7 @@ module Guard def kill_unmanaged_pid! if pid = unmanaged_pid - system %{kill -INT #{pid}} + system %{kill -KILL #{pid}} end end @@ -80,6 +80,12 @@ module Guard return line.split("\s")[1] end } + elsif RbConfig::CONFIG['host_os'] =~ /linux/ + %x{lsof -i :#{options[:port]}}.each_line { |line| + if line["*:#{options[:port]} "] + return line.split("\s")[1] + end + } end nil end