Re: [Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Davide Franco
Hello,

I can produce Fedora 32 rpm packages if you think that can help you.

Please let me know.

Best,

Davide

On Tue, 21 Jul 2020 at 00:59, Gary R. Schmidt 
wrote:

> On 2020-07-21 08:29, Greg Woods wrote:
>
> I am migrating my Bacula director and database from a Fedora 31 machine
> running 9.4 to a new
> Fedora 32 machine running 9.6. I am having what seems like a simple
> configuration issue but I can't figure it out after about an hour of
> Googling around and trying different things by trial and error. The error I
> get is this:
>
> [root@seveneves greg]# bacula-dir -t -c /etc/bacula/bacula-dir.conf
> bacula-dir: dird.c:1248-0 Dbdriver field within director config file
> "mysql" mismatched with the Database argument "PostgreSQL" passed during
> Bacula compilation.
>
> You have Bacula built for PostgreSQL, that is what the message is telling
> you.
>
>
> Bacula can only be built with support for one database, if you want to use
> MySQL you will either have to ask the distribution  maintainers to produce
> one, or build Bacula yourself from source.
>
>
> Cheers,
>
> GaryB-)
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Dmitri Maziuk

On 7/20/2020 8:50 PM, Gary R. Schmidt wrote:


Every day that you learn something new is a good day!

I had no idea that Fedora had anything like that - I've seen it on 
Solaris - I will have to add it to my "things that you needed to know 
before you broke that" list.  :-)


It's from debian actually, /bin/whatever is a symlink to 
/etc/alternatives/whatever, which in turn a symlink to something else, 
and it's symlinks all the way down. ;)


But yeah, that's the library I was thinking of.

The proper way of doing it is to make a libfoo-postgres and libfoo-mysql 
RPMs and each would `update alternatives` in its postinst script and 
it'll all magically "just work". Except when it doesn't.


Dima


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Gary R. Schmidt

On 21/07/2020 10:38, Greg Woods wrote:



On Mon, Jul 20, 2020 at 5:43 PM Dmitri Maziuk > wrote:


On 7/20/2020 6:31 PM, Gary R. Schmidt wrote:
 > On 21/07/2020 09:21, Greg Woods wrote:
 >>
 >> Has this always been the case?
 > Yes.
 >

Wow. I could swear I installed a backend-specific library RPM and
made a
symlink or something in the version we're using. It all must've been a
figment of my imagination I guess.


Maybe not, because I found the answer. I tried downgrading as I 
suggested to myself above, but it didn't work. I was running the exact 
same RPM packages for Bacula that I was running on my older system, and 
it still complained that Bacula was compiled for Postgres.


It turns out that Fedora has this "alternatives" system. It defines, for 
example, whether "/usr/bin/sendmail" will point to "sendmail" or 
"postfix" for mail delivery. They have done this for Bacula too; there 
is a library called "libbaccats.so" which is apparently linked to by 
their Bacula binaries, and the alternatives system can be used to 
determine whether this points to a MySQL, PostgreSQL, or SQLite3 
version. I finally hit upon the right Google search words to find this: 
https://src.fedoraproject.org/rpms/bacula . Since I have always run my 
Director on a Fedora machine, this explains why I didn't realize Bacula 
was designed to be hard-compiled for a single database backend.


After reading this, I knew that PostgreSQL is the default, but it can be 
changed by running "alternatives --config libbaccats.so" and selecting 
the MySQL option.


The alternatives system is quite slick as can be seen here; it's easy to 
use one set of Bacula packages no matter which database you are using; 
no separate package or compiling from source necessary. But it's not 
always easy to figure out which things have "alternatives" and how to 
use them. Worse still, it appears that I must have gone down this road 
before, as even on my older system, Postgres is the default but it had 
already been set to use MySQL. I really wish my Google search fu was 
better, then I could have avoided all this.




Every day that you learn something new is a good day!

I had no idea that Fedora had anything like that - I've seen it on 
Solaris - I will have to add it to my "things that you needed to know 
before you broke that" list.  :-)


Cheers,
GaryB-)




___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Greg Woods
On Mon, Jul 20, 2020 at 5:43 PM Dmitri Maziuk 
wrote:

> On 7/20/2020 6:31 PM, Gary R. Schmidt wrote:
> > On 21/07/2020 09:21, Greg Woods wrote:
> >>
> >> Has this always been the case?
> > Yes.
> >
>
> Wow. I could swear I installed a backend-specific library RPM and made a
> symlink or something in the version we're using. It all must've been a
> figment of my imagination I guess.
>

Maybe not, because I found the answer. I tried downgrading as I suggested
to myself above, but it didn't work. I was running the exact same RPM
packages for Bacula that I was running on my older system, and it still
complained that Bacula was compiled for Postgres.

It turns out that Fedora has this "alternatives" system. It defines, for
example, whether "/usr/bin/sendmail" will point to "sendmail" or "postfix"
for mail delivery. They have done this for Bacula too; there is a library
called "libbaccats.so" which is apparently linked to by their Bacula
binaries, and the alternatives system can be used to determine whether this
points to a MySQL, PostgreSQL, or SQLite3 version. I finally hit upon the
right Google search words to find this:
https://src.fedoraproject.org/rpms/bacula . Since I have always run my
Director on a Fedora machine, this explains why I didn't realize Bacula was
designed to be hard-compiled for a single database backend.

After reading this, I knew that PostgreSQL is the default, but it can be
changed by running "alternatives --config libbaccats.so" and selecting the
MySQL option.

The alternatives system is quite slick as can be seen here; it's easy to
use one set of Bacula packages no matter which database you are using; no
separate package or compiling from source necessary. But it's not always
easy to figure out which things have "alternatives" and how to use them.
Worse still, it appears that I must have gone down this road before, as
even on my older system, Postgres is the default but it had already been
set to use MySQL. I really wish my Google search fu was better, then I
could have avoided all this.

--Greg
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Dmitri Maziuk

On 7/20/2020 6:31 PM, Gary R. Schmidt wrote:

On 21/07/2020 09:21, Greg Woods wrote:


Has this always been the case?

Yes.



Wow. I could swear I installed a backend-specific library RPM and made a 
symlink or something in the version we're using. It all must've been a 
figment of my imagination I guess.


Dima


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Gary R. Schmidt

On 21/07/2020 09:21, Greg Woods wrote:



On Mon, Jul 20, 2020 at 4:56 PM Gary R. Schmidt 
mailto:g...@mcleod-schmidt.id.au>> wrote:


Bacula can only be built with support for one database, if you want
to use MySQL you will either have to ask the distribution 
maintainers to produce one, or build Bacula yourself from source.



Has this always been the case?

Yes.

Cheers,
GaryB-)


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Greg Woods
On Mon, Jul 20, 2020 at 4:56 PM Gary R. Schmidt 
wrote:

> Bacula can only be built with support for one database, if you want to use
> MySQL you will either have to ask the distribution  maintainers to produce
> one, or build Bacula yourself from source.
>

Has this always been the case? If so, why is there a "dbdriver" parameter
in the director configuration at all, if it cannot actually be used?

I could certainly buy that the Fedora package maintainer decided to switch
from MySQL (which has always worked in every previous Fedora distribution
since I started using Bacula back with version 5) to PostgreSQL; this sort
of thing happens in Fedora. I did verify that the Bacula 9.4 packaged for
Fedora 31 seems to be set for MySQL, because if I try to specify "dbdriver
= postgresql" on my old 9.4/F31 box, then I get the converse error:

20-Jul 17:05 bacula-dir JobId 0: Warning: Dbdriver field within director
config file "postgresql" mismatched with the Database argument "MySQL"
passed during Bacula compilation.

Assuming this is all correct: I think there is nearly zero chance of
getting the Fedora people to produce a different package; Fedora is
notoriously short of package maintainers. So I could either compile 9.6
from source, or downgrade to the Fedora 31 version that worked with MySQL.
I have the additional issue to deal with that my Storage server is on a
Raspbian system which of course isn't going to get new Bacula versions
until the next OS upgrade, but I have found that generally different minor
versions work together just fine as long as it's the same major version.  I
realize it's not guaranteed unless DIR = SD >= FD.

Thanks for setting me straight, one way or the other I can move forward now.

--Greg
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Gary R. Schmidt

On 2020-07-21 08:29, Greg Woods wrote:

I am migrating my Bacula director and database from a Fedora 31 machine running 9.4 to a new 
Fedora 32 machine running 9.6. I am having what seems like a simple configuration issue but I can't figure it out after about an hour of Googling around and trying different things by trial and error. The error I get is this:


[root@seveneves greg]# bacula-dir -t -c /etc/bacula/bacula-dir.conf
bacula-dir: dird.c:1248-0 Dbdriver field within director config file "mysql" mismatched 
with the Database argument "PostgreSQL" passed during Bacula compilation.


You have Bacula built for PostgreSQL, that is what the message is
telling you. 


Bacula can only be built with support for one database, if you want to
use MySQL you will either have to ask the distribution  maintainers to
produce one, or build Bacula yourself from source. 

   Cheers, 


   GaryB-)___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] how to tell 9.6 director to use mysql?

2020-07-20 Thread Greg Woods
I am migrating my Bacula director and database from a Fedora 31 machine
running 9.4 to a new
Fedora 32 machine running 9.6. I am having what seems like a simple
configuration issue but I can't figure it out after about an hour of
Googling around and trying different things by trial and error. The error I
get is this:

[root@seveneves greg]# bacula-dir -t -c /etc/bacula/bacula-dir.conf
bacula-dir: dird.c:1248-0 Dbdriver field within director config file
"mysql" mismatched with the Database argument "PostgreSQL" passed during
Bacula compilation.
bacula-dir: dird.c:1273-0 Could not open Catalog "GregAndEva", database
"bacula".
bacula-dir: dird.c:1279-0 postgresql.c:330 Unable to connect to PostgreSQL
server. Database=bacula User=bacula
Possible causes: SQL server not running; password incorrect;
max_connections exceeded.
20-Jul 16:24 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf

This is my Catalog definition:

Catalog {
  Name = GregAndEva
# Uncomment the following line if you want the dbi driver
  dbdriver = "mysql";
  dbname = "bacula"; dbuser = "bacula"; dbpassword = "MY BIG SECRET";
}

Unmodified from what worked on 9.4 . I also tried "dbdriver="dbi:mysql"
with the same result.

Could somebody just tell me what the proper incantation is here?

Thank you,
--Greg
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] FileSet definition | Location for scripts

2020-07-20 Thread armin . vehr

Hi Bacula users!

My CentOS 7 bacula server uses Bacula v5.2

In my bacula-dir.conf I want to reference a script to be executed within 
a FileSet block.


Unfortunately I always get this error message whenever the job is being 
executed:



Fatal error: Error running program: excludeBigFiles.sh. ERR=No such file 
or directory



(The script's name is written correctly. I checked it again and again.)

This is the related config section:


Client {
  Name = mybaculaclient-fd
  Address = 192.168.8.52
  FDPort = 9102
  Catalog = MyCatalog
  Password = "myCrypticPassphrase"
  File Retention = 10 weeks
  Job Retention = 126 days
  AutoPrune = yes
}

FileSet {
  Name = "fs-mybaculaclient"
  Include {
Options {
  WildFile = "*.vmdk"
  WildFile = "*.iso"
  WildFile = "*.api"
  WildDir = "*X_CustomerData*"
  WildDir = "*F_InternalData*"
  exclude = yes
}
Options {
  signature = MD5
  compression = GZIP
  ignore case = yes
}
File = /datadisk

  }
  Exclude {
File = "/datadisk/ExchangeDrive"
File = "/datadisk/TypeF_data"
File = "/datadisk/TypeC_projects"
File = "workspace"
File = "\|excludeBigFiles.sh"
  }
}

Job {
  JobDefs = "DefaultJob"
  Name = "mybaculaclient-cli"
  Client = mybaculaclient-fd
  FileSet = "fs-mybaculaclient"
}


Maybe the first question: Where do I have to store the script? Currently 
it is saved to /etc/bacula on the bacula server as well as on the 
client. The file permissions on the script are bacula:bacula and 755.

I already tried to reference the script by absolute path:


Exclude {
File = "/datadisk/ExchangeDrive"
File = "/datadisk/TypeF_data"
File = "/datadisk/TypeC_projects"
File = "workspace"
File = "\|/etc/bacula/excludeBigFiles.sh"
  }


I also tried it by executing the script on the bacula server:


Exclude {
File = "/datadisk/ExchangeDrive"
File = "/datadisk/TypeF_data"
File = "/datadisk/TypeC_projects"
File = "workspace"
File = "|excludeBigFiles.sh"
  }


also:


Exclude {
File = "/datadisk/ExchangeDrive"
File = "/datadisk/TypeF_data"
File = "/datadisk/TypeC_projects"
File = "workspace"
File = "|/etc/bacula/excludeBigFiles.sh"
  }


Always the same error.

Thanks in advance!

Best regards
Armin

__ Information from mm-lab IT security __The message was 
checked by ESET Mail Security.


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users