8000 collectd -t should test config · Issue #3216 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

collectd -t should test config #3216

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

Open
rpv-tomsk opened this issue Jul 13, 2019 · 6 comments 8000
Open

collectd -t should test config #3216

rpv-tomsk opened this issue Jul 13, 2019 · 6 comments
Labels
Bug A genuine bug

Comments

@rpv-tomsk
Copy link
Contributor
rpv-tomsk commented Jul 13, 2019
  • Version of collectd: 5.8.0

Expected behavior

Collectd should test config and report if it is broken/has errors.

Actual behavior

Daemon exits without config test.

Steps to reproduce

run collectd -t on broken config.
It exits immediately w/o any output.

@Whissi
Copy link
Contributor
Whissi commented Jul 29, 2019

I just wanted to report a similar issue: collectd 5.9.1 isn't starting here with errors like

Plugin syslog failed to handle option LogLevel, return code: 1

or

Plugin iptables failed to handle option Chain, return code: 1

However, configtest reports no problem.

@faxm0dem
Copy link
Contributor

@Whissi due to #3232 too

@Whissi
Copy link
Contributor
Whissi commented Jul 30, 2019

I am not sure if this is the same problem. Sure: Once the mentioned bug is fixed, the reported plugins are working. However, isn't the problem that the plugins will report an error for whatever reason and the configtest doesn't notice?

I.e. see #3236 (comment) ... even with the patch applied, collectd -t didn't report an error. After recompiling collectd with --enable-debug which seems like making loglevel debug available, it worked.

@faxm0dem
Copy link
Contributor

you're absolutely right, thanks for clarifying this

@mrunge mrunge added the Bug A genuine bug label Aug 2, 2019
@kkepka
Copy link
Contributor
kkepka commented Nov 5, 2019

Using bisect and totally not valid config

$ cat /opt/collectd/etc/collectd.conf
badconfig

found that this behavior has changed probably with 386ecab

$ /opt/collectd/sbin/collectd -t
$ echo $?
0

one earlier 6b64979 have build issue on Ubuntu16.04 and next one 6cde759 was working as following:

$ /opt/collectd/sbin/collectd -t
Parse error in file `/opt/collectd/etc/collectd.conf', line 2 near `<newline>': syntax error, unexpected EOL
yyparse returned error #1
configfile: Cannot read file `/opt/collectd/etc/collectd.conf'.
Unable to read config file /opt/collectd/etc/collectd.conf.
Error: Reading the config file failed!
Read the logs for details.
$ echo $?
1

I'm not fully familiar with daemon yet, so just sharing this find here for now and hope to get back later to investigate logic that was affected. Starting point most probably will be src/daemon/collectd.c#L402-L403 and verifying if code responsible for testing config is being executed somewhere before.

@eero-t
Copy link
Contributor
eero-t commented Jan 26, 2024

This seems to have been already fixed by #3793? If yes, please close.

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

No branches or pull requests

6 participants
0