[chef] Re: Package doesnt notify service?


Chronological Thread 
  • From: Bryan Baugher < >
  • To:
  • Subject: [chef] Re: Package doesnt notify service?
  • Date: Mon, 7 May 2012 13:16:56 -0500

The notification from the package resource will only be sent if the package is being installed or upgraded. So if you already have the latest version of your package then the notification won't be executed.

I am also a little confused by your logic. In most cookbooks I have seen the service resource will start itself using the ':start' action and the package would if necessary send a ':restart' notification. It seems strange to rely on the package to start the service.

On Mon, May 7, 2012 at 1:10 PM, Geoff Meakin < " target="_blank"> > wrote:
Hi all,

Using chef 0.10.4 (slightly out of date i know)

I would expect the following to start service mongodb as soon as the package is installed… but instead it wilfully ignored the notified directive, while installing the package

Anybody have any ideas?


case node['platform']
when "debian", "ubuntu"

 package "mongodb" do
   package_name "mongodb-10gen"
   notifies :start, "service[mongodb]", :immediately
 end

end

service "mongodb" do
 supports :restart => true, :status => true
 action :nothing
end



--
-Bryan



Archive powered by MHonArc 2.6.16.

§