Skip to content
This repository has been archived by the owner on Jan 27, 2019. It is now read-only.

fix for ubuntu with systemd #79

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
bash "install-collectd" do
cwd Chef::Config[:file_cache_path]
code <<-EOH
tar -xzf collectd-#{node["collectd"]["version"]}.tar.gz
tar -xf collectd-#{node["collectd"]["version"]}.tar.gz
(cd collectd-#{node["collectd"]["version"]} && ./configure --prefix=#{node["collectd"]["dir"]} #{node["collectd"]["configure_flag"]} && make && make install)
EOH
not_if "#{node["collectd"]["dir"]}/sbin/collectd -h 2>&1 | grep #{node["collectd"]["version"]}"
Expand Down Expand Up @@ -103,8 +103,21 @@
)
notifies :restart, "service[collectd]"
only_if { node["init_package"] == "systemd" }
not_if { node["platform"] == "ubuntu" }
end

template "/lib/systemd/system/collectd.service" do
mode "0644"
variables(
:dir => node["collectd"]["dir"]
)
notifies :restart, "service[collectd]"
only_if { node["init_package"] == "systemd" }
only_if { node["platform"] == "ubuntu" }
end



template "#{node["collectd"]["dir"]}/etc/collectd.conf" do
mode "0644"
source "collectd.conf.erb"
Expand Down