Class: ThinkingSphinx::Interfaces::Daemon

Inherits:
Base
  • Object
show all
Defined in:
lib/thinking_sphinx/interfaces/daemon.rb

Instance Method Summary collapse

Methods included from WithOutput

#initialize

Instance Method Details

#startObject



4
5
6
7
8
9
10
# File 'lib/thinking_sphinx/interfaces/daemon.rb', line 4

def start
  if command :running
    raise ThinkingSphinx::SphinxAlreadyRunning, 'searchd is already running'
  end

  command(options[:nodetach] ? :start_attached : :start_detached)
end

#statusObject



12
13
14
15
16
17
18
# File 'lib/thinking_sphinx/interfaces/daemon.rb', line 12

def status
  if command :running
    stream.puts "The Sphinx daemon searchd is currently running."
  else
    stream.puts "The Sphinx daemon searchd is not currently running."
  end
end

#stopObject



20
21
22
# File 'lib/thinking_sphinx/interfaces/daemon.rb', line 20

def stop
  command :stop
end