-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
telegraf init script hides syntax errors #1344
Comments
This way I discovered that the generated config with contained the following line that does not seem to be supported:
Log:
|
Thanks |
from #1740: Bug reportRelevant telegraf.conf:Specifically broken:
System info:telegraf 1.0.0 on CentOS 6. Steps to reproduce:Break the config with an invalid param. Attempt to start the service using the Red Hat LSB init script. Expected behavior:I should be told the service failed to start (the binary does return a non zero exit code it just gets lost in all the Bash / Su / nohup in there). At the very least I should see the config parser error in the log file. Actual behavior:The service starts but dies immediately, but it tells me it started ok. No error message in the log because the init script sends STDOUT to /dev/null. Actual error message is this:
Proposal:Quick fix would be to just not bury STDOUT, so you can at least see error in the log. More robust ways of handling this would be to introduce a config parser option, so you could test the config file validity first before you tried to spawn the real instance. Another way might be to use the Red Hat daemon() function in /etc/rc.d/init.d/functions, but then you don't have a cross platform init script. |
Bug report
System info:
telegraf 0.13.1 (debian package) on Debian wheezy.
Steps to reproduce:
Expected behavior:
Non-OK output from init script, with info on syntax error.
Actual behavior:
# /etc/init.d/telegraf start
Starting the process telegraf [ OK ]
telegraf process was started [ OK ]
Additional info:
Nothing useful in /var/log/telegraf/telegraf.log
Switching to telegraf user, starting daemon provides useful output (line number of syntax error)
The text was updated successfully, but these errors were encountered: