Executing ldconfig in chef


#1

Newbie alert

Code snippets are from default.rb

Hi, I’m adding a file to ld.so.conf.d:

file ::File.join("/etc/ld.so.conf.d", “my.conf”) do
mode "0444"
content ::File.join(node[“folders”][“home”],“lib”)
notifies :run, "bash[ldconfig]"
end

bash “ldconfig” do
code <<-EOS
ldconfig
EOS
end

The ldconfig doesn’t get called (at least not after the file creation).
I tried running a “command” and also “bash” as posted.

Appreciate any help.


#2

The first step is to take a look at the logs when you run chef-client.
Do you see it saying 'executing resource bash[ldconfig] anywhere?

note that if one of my guys handed me that, i’d ask them to replace the
bash resource with an execute resource.

Because you don’t have an action :nothing on the bash resource, it should
be running every time, which should help diagnose further.

On Mon, Feb 4, 2013 at 9:49 AM, chook.harel@gmail.com wrote:

Newbie alert

Code snippets are from default.rb

Hi, I’m adding a file to ld.so.conf.d:

file ::File.join("/etc/ld.so.conf.d", “my.conf”) do
mode "0444"
content ::File.join(node[“folders”][“home”],“lib”)
notifies :run, "bash[ldconfig]"
end

bash “ldconfig” do
code <<-EOS
ldconfig
EOS
end

The ldconfig doesn’t get called (at least not after the file creation).
I tried running a “command” and also “bash” as posted.

Appreciate any help.