Skip to content

Commit

Permalink
Reaper knows how to find processes even if the dispatch path is very …
Browse files Browse the repository at this point in the history
…long. Closes #2711.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2851 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Nov 2, 2005
1 parent aabf909 commit 26311f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*

* Reaper knows how to find processes even if the dispatch path is very long. #2711 [matthew@walker.wattle.id.au]

* Make fcgi handler respond to TERM signals with an explicit exit [Jamis Buck]

* Added demonstration of fixture use to the test case generated by the model generator [DHH]
Expand Down
6 changes: 3 additions & 3 deletions railties/lib/commands/process/reaper.rb
Expand Up @@ -32,15 +32,15 @@ def process_keywords(action, *keywords)
# ProgramProcess.find_by_keyword("basecamp")
def find_by_keyword(keyword)
process_lines_with_keyword(keyword).split("\n").collect { |line|
next if line.include?("inq") || line.include?("ps -ax") || line.include?("grep")
next if line.include?("inq") || line.include?("ps -axww") || line.include?("grep")
pid, *command = line.split
new(pid, command.join(" "))
}.compact
end

private
def process_lines_with_keyword(keyword)
`ps -ax -o 'pid command' | grep #{keyword}`
`ps -axww -o 'pid command' | grep #{keyword}`
end
end

Expand Down Expand Up @@ -127,4 +127,4 @@ def to_s #:nodoc:
opts.parse!
end

ProgramProcess.process_keywords(OPTIONS[:action], OPTIONS[:dispatcher])
ProgramProcess.process_keywords(OPTIONS[:action], OPTIONS[:dispatcher])

0 comments on commit 26311f6

Please sign in to comment.