Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Declares Upstart config before declaring the service
Browse files Browse the repository at this point in the history
When converging, Chef looks for /etc/init/statsd.conf to create
the service. The file hasn't been created yet which ends up throwing
an exception.
  • Loading branch information
Martin Cozzi committed Jul 29, 2014
1 parent 248d5eb commit 63073cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Installs/Configures statsd'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.3.0'
version '0.3.1'

depends 'build-essential'
depends 'git'
Expand Down
12 changes: 6 additions & 6 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
end
end

template '/etc/init/statsd.conf' do
source 'upstart.conf.erb'
mode 0644
notifies :restart, 'service[statsd]', :delayed
end

service 'statsd' do
provider Chef::Provider::Service::Upstart
restart_command 'stop statsd; start statsd'
Expand Down Expand Up @@ -102,12 +108,6 @@
notifies :restart, 'service[statsd]', :delayed
end

template '/etc/init/statsd.conf' do
source 'upstart.conf.erb'
mode 0644
notifies :restart, 'service[statsd]', :delayed
end

file node['statsd']['log_file'] do
owner node['statsd']['user']
group node['statsd']['group']
Expand Down

0 comments on commit 63073cf

Please sign in to comment.