[chef] Re: How to check that service is stopped, and if not - stop it ?


Chronological Thread 
  • From: Christopher Armstrong < >
  • To:
  • Subject: [chef] Re: How to check that service is stopped, and if not - stop it ?
  • Date: Mon, 14 Oct 2013 23:25:12 -0700

I'm not sure where in your code sample you are trying to stop a service, but you can easily do this with the service resource: http://docs.opscode.com/resource_service.html

Example:
service "nginx" do
  action :stop
end



On Mon, Oct 14, 2013 at 11:22 PM, Vladimir Skubriev < " target="_blank"> > wrote:
How to check that service is stopped, and if not - stop it ?

For example in this code block:


# See if needed http://stackoverflow.com/questions/14809840/installation-of-redmine-with-bundler-requires-root-password
bash "bundle_redmine_mylyn" do
  cwd "#{node['redmine']['datafs']}/redmine/plugins/redmine_mylyn_connector"
  user node['apache']['user']
  code <<-EOH
              # We doing source because of interactive shell don't read our .profile
              source #{node['redmine']['home']}/.rvm/scripts/rvm
              bundle install
  EOH
end


And Can write some not_if's only_if's for example

do
    not_if
    not_if
    only_if
    only_if
end

?

--
Best regards,

CVision Lab System Administrator
Vladmir Skubriev





Archive powered by MHonArc 2.6.16.

§