Class: ThinkingSphinx::Commands::StartAttached

Inherits:
Base
  • Object
show all
Defined in:
lib/thinking_sphinx/commands/start_attached.rb

Instance Method Summary collapse

Methods inherited from Base

call, #call_with_handling

Methods included from WithOutput

#initialize

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/thinking_sphinx/commands/start_attached.rb', line 4

def call
  FileUtils.mkdir_p configuration.indices_location unless skip_directories?

  unless pid = fork
    controller.start :verbose => options[:verbose], :nodetach => true
  end

  Signal.trap('TERM') { Process.kill(:TERM, pid) }
  Signal.trap('INT')  { Process.kill(:TERM, pid) }

  Process.wait(pid)
end