[chef] how to use service to restart supervisor


Chronological Thread 
  • From: David Montgomery < >
  • To:
  • Subject: [chef] how to use service to restart supervisor
  • Date: Sat, 7 Sep 2013 11:55:26 +0800

Hi

I use supervisor and I want to restart a service e.g..

bash "restart_supervisorctl_master" do
  code <<-EOH
    sudo supervisorctl restart master_server:
  EOH
  action :nothing
end

template "/etc/supervisor/conf.d/master.conf" do
  path "/etc/supervisor/conf.d/master.conf"
  source "supervisord.master.conf.erb"
  owner "root"
  group "root"
  mode "0755"
  variables :version => version
  notifies :run, 'bash[restart_supervisorctl_master]', :delayed
end

But if I wanted to restart supervisor I would the below but would restart every service in supervisor.
service "supervisord"

notifies :restart, resources(:service => "supervisord")


So...it there a more chefonic method for defining a service for supervisorctl so I can restart using notifies :restart, resources(:service => "supervisorctl master_server")?

Thanks



Archive powered by MHonArc 2.6.16.

§