2

I have a MySQL configuration file with an !includedir directive. The directive seems to show up properly when the lens examines the file:

$ sudo augtool print /files/etc/my.cnf | fgrep includedir
/files/etc/my.cnf/!includedir = "/etc/mysql/conf.d/"

However, while augtool prints out the path when examining /etc/my.cnf, it keeps complaining about an invalid path expression if I try to print or examine the actual node. For example:

$ sudo augtool
augtool> print /files/etc/my.cnf/!includedir
error: Invalid path expression
error: empty name
/files/etc/my.cnf/|=|!includedir

How can I use Augeas 1.0.0 to manage the !includedir directive in the /etc/my.cnf file?

1

! cannot be used in paths. You can however use the label() function to select that node:

augtool> print /files/etc/mysql/my.cnf/*[label()="!includedir"]
/files/etc/mysql/my.cnf/!includedir = "/etc/mysql/conf.d/"

Path expressions are documented on the Augeas wiki.

-1

This is a common problem, mysql uses .ini like config files, and every tool tries to handle it like that.. I don't found normal solution for that, but you can always fork / rewrite the current .ini parsing method. And that's not a really good thing.

At the end I solved this by my site like you can have 2 my.cnf files simultaneously /etc/my.cnf and ~/.my.cnf I tried to move my client bindings to these two files. (ok, when they are server config options, I don't have any idea what to do, expect hackety-hack.) :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.