On 13.09.2017 at 23:26 wrote Nathan Johnson: > It would be pretty useful for me if I could link to a shared library > with knowledge of how to parse configuration files, particularly the > functionality within src/dird/dird_conf.c . I'm currently trying to > pull the functionality into a shared lib and have bareos-dir just > link to that, but it's a bit thorny. Is there another easier > built-in way to be able to do this? Ideally I'd like to have a third > party application be able to do a sort of lint check on configuration > before writing new configs to disk and telling bareos-dir to reload. > It would also be nice to be able to do this for the bareos-sd > configs.
Yes, I believe that this will be thorny, especially as the functionality is mixed in the general parser and dird_conf.c. How about bareos-dir -c /you_path_to_a_configuration_directory_to_test/ -t or bareos-dir -c /you_configuration_file_to_test -t ? This will also work for the other daemon. With "-t" the director will also test if it has access to the catalog database and if the schema version is right. Maybe this is not wanted in your case, however, I assume it much easier to adapt this check instead of moving it to a shared library. If you are looking for runtime changes, take a look how the "configure add" bconsole handles this. Are you also aware of "bareos-dir -xs" to export the configuration schema? Last (and least): there is also the "bareos-config set_config_param" functionality, to change configuration files. Used by some installer to adapt the database setting. Example: /usr/lib/bareos/scripts/bareos-config set_config_param "bareos-dir" "Catalog" "MyCatalog" "dbdriver" "mysql" This works quite well, however is far from being perfect (uses a awk script). Hope this helps. Jörg -- Jörg Steffens joerg.steff...@bareos.com Bareos GmbH & Co. KG Phone: +49 221 630693-91 http://www.bareos.com Fax: +49 221 630693-10 Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646 Komplementär: Bareos Verwaltungs-GmbH Geschäftsführer: S. Dühr, M. Außendorf, Jörg Steffens, P. Storz -- You received this message because you are subscribed to the Google Groups "bareos-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to bareos-devel+unsubscr...@googlegroups.com. To post to this group, send email to bareos-devel@googlegroups.com. For more options, visit https://groups.google.com/d/optout.