Config file finding unexpected $end, not sure why

橙三吉。 提交于 2019-12-13 02:37:22

问题


I am using a custom config of collectd and for some reason I keep getting a failure when I try and run the service. Originally I had everything in one big file, but to make changing configs easier I want to separate out the settings for various plugins and components. Collectd has a Include option to do exactly this. It seems to work, but when collectd tries to grab the external part of the program I get the following error:

Parse error in file `/etc/collectd/collectd.conf.d/http.conf', line 1100 near `': syntax error, unexpected $end, expecting EOL

If I go in and copy paste direct into the server using vim, it will work. However when the package installs it won't. I know these kinds of errors can come from mismatched brackets or quotes or something, but his is not a problem in these files. Is there anything else which could cause such an error?


回答1:


For the users they have similar error at you. For my case, i have not return line at the bottom of collectd.conf or plugins configuration files. For verify, you can use this command

$ xxd collectd.conf | tail -n1 | grep 0a

00001c0: 730a 0a                                  s..

You must see the 0a at the end of the file

Note : You can replace collectd.conf by plugins configuration files



来源:https://stackoverflow.com/questions/31753775/config-file-finding-unexpected-end-not-sure-why

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!