Skip to content

Commit

Permalink
Change plugin dir, stop service started by package install
Browse files Browse the repository at this point in the history
  • Loading branch information
sh9189 committed Feb 8, 2016
1 parent d7fb64f commit 4514cfa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion attributes/default.rb
Expand Up @@ -10,7 +10,11 @@
default['collectd']['service_group'] = 'collectd'

default['collectd']['service']['config_directory'] = '/etc/collectd.d'
default['collectd']['service']['configuration']['plugin_dir'] = '/usr/lib/collectd'
default['collectd']['service']['configuration']['plugin_dir'] =
value_for_platform_family(
'rhel' => '/usr/lib64/collectd',
'debian' => '/usr/lib/collectd'
)
default['collectd']['service']['configuration']['types_d_b'] = '/usr/share/collectd/types.db'
default['collectd']['service']['configuration']['interval'] = 10
default['collectd']['service']['configuration']['read_threads'] = 5
Expand Down
7 changes: 7 additions & 0 deletions libraries/collectd_service.rb
Expand Up @@ -108,6 +108,13 @@ def action_enable
notifies :restart, new_resource, :delayed
end

# Installing package starts collectd service automatically
# Disable this so that collectd can be managed through poise-service
service new_resource.package_name do
action [:disable, :stop]
only_if { platform?('ubuntu') }
end

[new_resource.directory, new_resource.config_directory].each do |dirname|
directory dirname do
recursive true
Expand Down

0 comments on commit 4514cfa

Please sign in to comment.