Sha256: 8006df44145385477dc787f4af744b6294c5588fcd91eef4ba591f31f4f96ab9

Contents?: true

Size: 888 Bytes

Versions: 8

Compression:

Stored size: 888 Bytes

Contents

namespace :sphinx do
  
  namespace :monit do
  
    desc <<-DESC
    Create monit configuration for sphinx.\n  
    *monit_conf_dir*: Destination for monitrc. _Defaults to "/etc/monit"_\n
    *sphinx_pid_path*: Location for sphinx pid. _Defaults to "[shared_path]/pids/searchd.pid"_\n
    
    "Source":#{link_to_source(__FILE__)}
    DESC
    task :setup do    
    
      # Settings
      fetch_or_default(:monit_conf_dir, "/etc/monit")
      fetch_or_default(:sphinx_pid_path, "#{shared_path}/pids/searchd.pid")
    
      put template.load("sphinx/sphinx.monitrc.erb"), "/tmp/sphinx_#{application}.monitrc"            
      sudo "install -o root /tmp/sphinx_#{application}.monitrc #{monit_conf_dir}/sphinx_#{application}.monitrc"
    end
  
    desc "Restart sphinx"
    task :restart do
      sudo "/sbin/service monit restart sphinx_#{application}"
    end    
    
  end
    
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
capitate-0.2.15 lib/recipes/monit/sphinx.rb
capitate-0.2.14 lib/recipes/monit/sphinx.rb
capitate-0.2.13 lib/recipes/monit/sphinx.rb
capitate-0.3.5 lib/recipes/monit/sphinx.rb
capitate-0.3.1 lib/recipes/monit/sphinx.rb
capitate-0.3.4 lib/recipes/monit/sphinx.rb
capitate-0.3.2 lib/recipes/monit/sphinx.rb
capitate-0.3.3 lib/recipes/monit/sphinx.rb