Class: RtSphinx::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/rt_sphinx/manager.rb

Class Method Summary collapse

Class Method Details

.kill_daemon_if_neededObject



11
12
13
14
# File 'lib/rt_sphinx/manager.rb', line 11

def self.kill_daemon_if_needed
  `pid=$(lsof -i :9327 -t); if [ $pid ] ; then kill -TERM $pid || kill -KILL $pid; fi;`
  sleep(1)
end

.startObject



5
6
7
8
9
# File 'lib/rt_sphinx/manager.rb', line 5

def self.start
  conf_file_path = File.join(File.expand_path('../../..', __FILE__), 'sphinx.conf')
  kill_daemon_if_needed
  puts `searchd --config #{conf_file_path}`
end