#1077 Issue closed: ReaR + Bareos >16.2 new configuration path/filename structure

Labels: bug, support / question, fixed / solved / done, external tool

wnglobal2000 opened issue at 2016-11-22 10:59:

Relax-and-Recover (rear) Issue Template

Please fill in the following items before submitting a new issue (quick response is not guaranteed with free support):

tree /etc/bareos/
/etc/bareos/
└── bareos-fd.d
├── client
│   └── myself.conf
├── director
│   ├── bareos-dir.conf
│   └── bareos-mon.conf
└── messages
└── Standard.conf

the following error occurs:
rear -v mkrescue
Relax-and-Recover 1.19 / Git
Using log file: /var/log/rear/rear-sandbox201610.log
ERROR: Bareos configuration file (bareos-fd.conf) missing
Aborting due to an error, check /var/log/rear/rear-sandbox201610.log for details
[1] 9490 terminated rear -v mkrescue

  • Work-around, if any
    manually fix Bareos settings in:
    /usr/share/rear/prep/BAREOS/default # ls
    40_prep_bareos.sh
    45_check_BAREOS_client_configured.sh
    50_check_BAREOS_bconsole_results.sh
    55_check_bareos_restore_jobs.sh
    56_check_bareos_filesets.sh

e.g. nano /usr/share/rear/prep/BAREOS/default/45_check_BAREOS_client_configured.sh

Tried with Bareos Version: 16.2.4
dpkg -l | grep bareos
ii bareos-common 16.2.4-12.1 amd64 Backup Archiving Recovery Open Sourced - common files
ii bareos-filedaemon 16.2.4-12.1 amd64 Backup Archiving Recovery Open Sourced - file daemon

gdha commented at 2016-11-23 13:51:

@aussendorf Could you have a look at this issue and suggest updates, comments, etc...?

jsmeix commented at 2017-01-03 14:44:

@aussendorf
could you have a look at this issue and suggest
updates, comments, etc...?

We cannot fix it for ReaR 2.0 - it is too late now
which means Bareos support in current ReaR will
not be as good as possible.

aussendorf commented at 2017-01-12 12:06:

Hello @jsmeix and @gdha , sorry for my late reply.

I've seen the workaround by @amtuannguyen, which looks like a good approach.
With Bareos 16.2 the 'old' way of using a configuration file is supported as well as the new layout, which uses subdirectories. I fear, that the above commit does not solve all situations, as it only fixes the requirement checking part, while the parts with program calls (like starting the fd) still use hardcoded "-c /etc/bareos/bareos-fd.conf" for example.

As bareos-fd and bconsole don't require a "-c" parameter, I suggest to leave it away. Both binaries will

  1. check, if the default configuration file is present ( /etc/bareos/bareos-fd.conf for fd) is present
  2. check if there is a configuration in the according subdirectory
    So there is no need to specify it and it will work with old and new layout this way.

Unless someone is using another config-filename, in this case an additional option would be needed (but that case wasn't covered anyway).

For the requirement checking I recommend to use -t, as it will check, if a configuration exists and can be loaded.

gdha commented at 2017-01-12 18:34:

@aussendorf Hi Maik - thank you for your insight into this matter (as SME). If you can improve the code do not hesitate and prepare a small pull request.

aussendorf commented at 2017-01-13 14:11:

Ok, I've also replaced greps in configfiles by calls to the program with -xc, which dumps the config.
A first shot (UNTESTED) is here:
https://github.com/aussendorf/rear

I've no testing environment at hand right now, so I will probably not be able to test it before next week.

jsmeix commented at 2017-01-18 08:15:

Since https://github.com/rear/rear/pull/1169
is merged this issue should be fixed.

@aussendorf
many thanks for your valuable contribution to ReaR!
In particular for the various different external backup methods
ReaR depends on contributions from pepole who are experts
in the individual backup methods.

ivveh commented at 2017-04-13 08:25:

Hi,
This error still exists for SLES 11 SP4 (rear-2.00-1.i586.rpm)
Creating with mkrescue or similair works fine. However, restores exits with missing bareos-fd.conf.

jsmeix commented at 2017-04-13 09:05:

@ivveh
the fix in https://github.com/rear/rear/pull/1169
is not in ReaR 2.0 see my above
https://github.com/rear/rear/issues/1077#issuecomment-270129226

You need the current ReaR upstream master code.

How to test the currently newest ReaR GitHub master code
independent of an already installed ReaR software:

Basically "git clone" it into a directory and then
configure and run it from within that directory like:

# git clone https://github.com/rear/rear.git

# cd rear

# vi etc/rear/local.conf

# usr/sbin/rear -d -D mkbackup

(note the relative paths "etc/rear/" and "usr/sbin/").

ivveh commented at 2017-04-13 10:09:

@jsmeix
Hello, I realized that and got the latest snap instead and everything worked out fine.
Sorry for the trouble!

jsmeix commented at 2017-04-13 12:56:

@ivveh
no worries!
I appreciate your prompt feedback that it works well
with current ReaR upstream master code.

Such explicit positive feedback helps us a lot
to know things actually do work well because
in particular I do not use third-party backup tools.

I always think I should have a look at third-party backup tools
but I never find the time to actually do it - perhaps I find time
when there are no issues directly in ReaR left... ;-)

ivveh commented at 2017-04-14 14:12:

@jsmeix
No worries. I must say I'm quite impressed over the automatic restore implementation with rear and bareos.
Just from installing the rpm/deb (tested with both ubuntu 16.04 & sles11 sp4) on a client and with the bareos client with just 4(?) lines of variables in the rear config file I was able to make an iso to a nfs share and restore it fully automated.


[Export of Github issue for rear/rear.]