Wednesday, May 23, 2018

Thankful for past programmers of mature open source system

I am a big fan  of Bacula. It is an enterprise-class backup system with a huge amount of flexibility when it comes to it's setup and the setup of the backup jobs. It was built to handle and manage tapes and has the most flexible way of selecting and choosing which directories and files to backup.
I've since moved on to Bareos, mainly because they were adding features and functions to the backup system that moving with the times. The decision to build a web-based user interface also mae me gravitate to their orbit.
Recently, I've been setting up Bareos with MySQL version 8. The main takeway when working with MySQL version 8 is that MySQL now made some default choices to be more of a secure variety.
Which leads to problems installing Bareos. Basically, the scripts written to set up the database took advantage of the lower security requirements of the previous versions of MySQL.
So I set about figuring our what to change and where. The scripts that were setting up the database were in /usr/lib/bareos/scripts/ . There were 3 scripts, create_bareos_database, make_bareos_tables and grant_bareos_privileges. All these scripts called another script called bareos-config-lib at the start of the scripts which provided the base functions and parameters. Running the scripts would throw up an error. I needed to see what was the command executing that was producing the errors. In this case, the commands were being provided through the bareos-config-lib script which itself called other files and scripts.
After poking around, I decided to think like an open source programmer, looked at other files in the same directory and started reading the code for clues. I found another script called bareos-config which took in a parameter. The parameter was the functions called in the bareos-config-lib. So the bareos-config-lib file had a function called get_database_grant_privileges. So to see what function provided, I executed bareos-config get_database_grant_privileges which then provided the output of the commands that executed the function. bareos-config get_database_driver will tell me what database Bareos is configured for. bareos-config get _database_password provides me with the database password used by Bareos to access the database. And so on and so forth.
This is a sign of a mature open source project. A tool exists to validate input or commands, created for the use of other future programmers.  Now I know what my problem is exactly and I can fix it. 

Recently Popular