Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collectd fails to start as generated config includes empty config #806

Open
sammcj opened this issue May 31, 2018 · 1 comment
Open

collectd fails to start as generated config includes empty config #806

sammcj opened this issue May 31, 2018 · 1 comment
Labels

Comments

@sammcj
Copy link

sammcj commented May 31, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.1 / PE 2018.1
  • Ruby: 2.4.3p205
  • Distribution: CentOS 7.5
  • Module version: v9.0.1

How to reproduce (e.g Puppet code you use)

include ::collectd

What are you seeing

collectd service fails to start using puppet generated config

What behaviour did you expect instead

collectd should start with minimal config.

/etc/collectd.conf should not contain Include "/etc/collectd.d/*.conf" unless there are files present in that directory.

/etc/collectd.conf:

# Generated by Puppet

#Hostname localhost
FQDNLookup true

#BaseDir "/var/lib/collectd"
#PluginDir "/usr/lib/collectd"
TypesDB "/usr/share/collectd/types.db"
Interval 10
Timeout 2
ReadThreads 5
WriteThreads 5
Include "/etc/collectd.d/*.conf"

/etc/collectd.d is empty by default:

~  # ls /etc/collectd.d/*.conf
ls: cannot access /etc/collectd.d/*.conf: No such file or directory

collectd cannot start:

~ # collectd
configfile: stat (/etc/collectd.d/*.conf) failed: No such file or directory

creating a blank conf file in /etc/collectd.d allows collectd to start:

~ # touch /etc/collectd.d/dummy.conf
~ # collectd
@juniorsysadmin
Copy link
Member

Trudging through the code recently myself while trying to refactor large parts of it, I'm not sure why the default is not purge => true rather than the current method of adding lines to a config that may or may not be put on disk by the collectd package. Perhaps adding a simple $manage_config => false parameter would be more flexible and more transparent to the user....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants