Skip to content

Commit

Permalink
Merge pull request #239 from jperville/chef-3694-install-inotify-tool…
Browse files Browse the repository at this point in the history
…s-only-once

Upstart: install inotify-tools only once (avoid CHEF-3694 warning).
  • Loading branch information
Tom Duffield committed Nov 19, 2014
2 parents 0fd4fb5 + 9a0175a commit 6b1746d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions providers/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,15 @@ def service_create_sysv

def service_create_upstart
# The upstart init script requires inotifywait, which is in inotify-tools
package 'inotify-tools' do
action :nothing
end.run_action(:install)
# For clarity, install the package here but do it only once (no CHEF-3694).
begin
run_context.resource_collection.find(:package => 'inotify-tools')
# If we get here then we already installed the resource the first time.
rescue Chef::Exceptions::ResourceNotFound
package('inotify-tools') do
action :nothing
end.run_action(:install)
end

template "/etc/init/#{service_name}.conf" do
source service_template
Expand Down

0 comments on commit 6b1746d

Please sign in to comment.