[chef] Re: Re: Re: Re: Stop multiple services


Chronological Thread 
  • From: ram karthik < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Stop multiple services
  • Date: Sun, 14 Sep 2014 21:31:11 -0700

Hi Tensibai,


I have tried "svc" , svc , "#{svc}" - nothing worked . Basically the contents of the file is as below which leaves scope for adding more services as required ,

cat /root/svc
auditd
vsftpd



On Sun, Sep 14, 2014 at 9:56 AM, Tensibai Zhaoying < " target="_blank"> > wrote:

Use the provider attribute if the service resource and your declaration should use the var without quotes or with #{svc}

See http://docs.getchef.com/resource_service.html for the service resource and provider attribute

Envoyé à partir de mon smartphone Sony Xperia™



---- ram karthik a écrit ----


require "chef/provider/service/init/redhat" returned load error , or Am I missing something

On Sun, Sep 14, 2014 at 1:52 AM, Tensibai Zhaoying < " target="_blank"> > wrote:

If it is inside a recipe you don't have to require the service provider, it will guess it.
If you really want to enforce it, there's a provider attribute to the service resource.

For the error message, require take a path to a file without the extension, here it should be require "chef/provider/service/init/redhat"

Envoyé à partir de mon smartphone Sony Xperia™



---- " target="_blank"> a écrit ----



I have multiple services that I need to stop , my code is as below ,

ruby_block "stopsvc" do
block do
services = File.readlines("/root/svc")
services.each do |svc|
require
Chef::Provider::Service::Init::Redhat
service "svc" do
action [ :stop, :disable]
end
end
end
end

"can't convert Class into String" is the error I am seeing . Please point what
I need ,





Archive powered by MHonArc 2.6.16.

§