问题描述
我使用的是collected的自定义配置,由于某种原因,当我尝试运行该服务时一直失败.最初,我将所有内容都存储在一个大文件中,但是为了使更改配置变得更加容易,我想将各种插件和组件的设置分开.收集有一个Include
选项可以做到这一点.它似乎可行,但是在收集后尝试获取程序的外部部分时,出现以下错误:
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
如果我进入并使用vim将粘贴直接复制到服务器中,它将起作用.但是,安装软件包时不会.我知道这类错误可能是由不匹配的括号或引号引起的,但他在这些文件中不是问题.还有其他可能导致这种错误的情况吗?
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?
推荐答案
对于用户,他们也会遇到类似的错误.就我而言,我没有在collectd.conf或插件配置文件的底部返回行.要进行验证,可以使用此命令
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..
您必须在文件末尾看到0a
You must see the 0a
at the end of the file
注意::您可以用插件配置文件替换collectd.conf
Note : You can replace collectd.conf by plugins configuration files
这篇关于配置文件发现意外的$ end,不确定原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!