我有一个带有!includedir指令的MySQLconfiguration文件。 该指令似乎在镜头检查文件时正确显示:
$ sudo augtool print /files/etc/my.cnf | fgrep includedir /files/etc/my.cnf/!includedir = "/etc/mysql/conf.d/"
但是,当检查/etc/my.cnf时,augtool会打印出path,如果我尝试打印或检查实际节点,它会一直抱怨pathexpression式无效。 例如:
$ sudo augtool augtool> print /files/etc/my.cnf/!includedir error: Invalid path expression error: empty name /files/etc/my.cnf/|=|!includedir
我如何使用Augeas 1.0.0来pipe理/etc/my.cnf文件中的!includedir指令?
! 不能在path中使用。 但是,您可以使用label()函数来select该节点:
augtool> print /files/etc/mysql/my.cnf/*[label()="!includedir"] /files/etc/mysql/my.cnf/!includedir = "/etc/mysql/conf.d/"
pathexpression式logging在Augeas wiki上。
这是一个常见的问题,MySQL使用.ini像configuration文件,每一个工具试图像这样处理它..我没有find正常的解决scheme,但你总是可以fork /重写当前的.iniparsing方法。 这不是一件好事。
最后,我通过我的网站解决了这个问题,比如你可以同时拥有2个my.cnf文件/etc/my.cnf和〜/ .my.cnf我试图将我的客户端绑定移动到这两个文件中。 (好吧,当他们是服务器configuration选项,我不知道该怎么做,期望hackety-hack。):(