Can't run bacula any more.

classic Classic list List threaded Threaded
79 messages Options
1234
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can't run bacula any more.

Erik P. Olsen-3
I have retired my old desktop and moved my programmes including bacula
to my laptop. Since I have been running bacula successfully for many
years I thought it would be piece of cake to install bacula on this
other box. But it turned out not to be so.

I am running linux with fedora 25 on both machines, and I've tried to
keep the new installation as close as possible to the old.

Bacula is installed from the dnf repository on both machines and is
version 7.4.5-1. I am aware that the bacula files from fedora's
repository are "infected" with postgresql, so I have changed them to
default to mysql. To the problem:

bacula-dir, bacula-fd and bacula-sd start correctly but testing the
directory yields:

[root@Erik-PC bacula]# bacula-dir -t -d10 -c bacula-dir.conf
bacula-dir: dird.c:208-0 Debug level = 10
bacula-dir: dird_conf.c:1958-0 runscript cmd=prune expired volume yes type=@
bacula-dir: dird_conf.c:1958-0 runscript cmd=/usr/libexec/bacula/make_catalog_backup.pl MyCatalog type=|
bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate storage=FileStorage pool=Files type=@
bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate storage=CatalogueStorage pool=Catalogues type=@
bacula-dir: dird_conf.c:1958-0 runscript cmd=/usr/libexec/bacula/delete_catalogue_backup type=|
bacula-dir: dird.c:969-0 Could not open Catalog "MyCatalog", database "bacula".
bacula-dir: dird.c:974-0 mysql.c:265 Unable to connect to MySQL server.
Database=bacula User=bacula
MySQL connect failed either server not running or your authorization is incorrect.
05-mar 11:58 bacula-dir ERROR TERMINATION
Please correct configuration file: bacula-dir.conf
[root@Erik-PC bacula]#

I don't see this on the old machine which works flawlessly.

I do hope someone will be able to pinpoint what the problem is or
perhaps give me a clue on how to diagnose it.

Thanks in advance,

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Kern Sibbald
Hello Erik,

It is pretty clear from the output that Bacula is unable to connect to
the MySQL server.  I recommend you either download the manual or use the
online html version from bacula.org and go to the chapter on setting up
the MySQL server.  This gives you a number of steps to work through
until hopefully the connection with the server will work.

Best regards,
Kern

On 03/05/2017 12:06 PM, Erik P. Olsen wrote:

> I have retired my old desktop and moved my programmes including bacula
> to my laptop. Since I have been running bacula successfully for many
> years I thought it would be piece of cake to install bacula on this
> other box. But it turned out not to be so.
>
> I am running linux with fedora 25 on both machines, and I've tried to
> keep the new installation as close as possible to the old.
>
> Bacula is installed from the dnf repository on both machines and is
> version 7.4.5-1. I am aware that the bacula files from fedora's
> repository are "infected" with postgresql, so I have changed them to
> default to mysql. To the problem:
>
> bacula-dir, bacula-fd and bacula-sd start correctly but testing the
> directory yields:
>
> [root@Erik-PC bacula]# bacula-dir -t -d10 -c bacula-dir.conf
> bacula-dir: dird.c:208-0 Debug level = 10
> bacula-dir: dird_conf.c:1958-0 runscript cmd=prune expired volume yes type=@
> bacula-dir: dird_conf.c:1958-0 runscript cmd=/usr/libexec/bacula/make_catalog_backup.pl MyCatalog type=|
> bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate storage=FileStorage pool=Files type=@
> bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate storage=CatalogueStorage pool=Catalogues type=@
> bacula-dir: dird_conf.c:1958-0 runscript cmd=/usr/libexec/bacula/delete_catalogue_backup type=|
> bacula-dir: dird.c:969-0 Could not open Catalog "MyCatalog", database "bacula".
> bacula-dir: dird.c:974-0 mysql.c:265 Unable to connect to MySQL server.
> Database=bacula User=bacula
> MySQL connect failed either server not running or your authorization is incorrect.
> 05-mar 11:58 bacula-dir ERROR TERMINATION
> Please correct configuration file: bacula-dir.conf
> [root@Erik-PC bacula]#
>
> I don't see this on the old machine which works flawlessly.
>
> I do hope someone will be able to pinpoint what the problem is or
> perhaps give me a clue on how to diagnose it.
>
> Thanks in advance,
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Bacula-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

J. Echter-2
In reply to this post by Erik P. Olsen-3
Am 05.03.2017 um 12:06 schrieb Erik P. Olsen:

> I have retired my old desktop and moved my programmes including bacula
> to my laptop. Since I have been running bacula successfully for many
> years I thought it would be piece of cake to install bacula on this
> other box. But it turned out not to be so.
>
> I am running linux with fedora 25 on both machines, and I've tried to
> keep the new installation as close as possible to the old.
>
> Bacula is installed from the dnf repository on both machines and is
> version 7.4.5-1. I am aware that the bacula files from fedora's
> repository are "infected" with postgresql, so I have changed them to
> default to mysql. To the problem:
>
> bacula-dir, bacula-fd and bacula-sd start correctly but testing the
> directory yields:
>
> [root@Erik-PC bacula]# bacula-dir -t -d10 -c bacula-dir.conf
> bacula-dir: dird.c:208-0 Debug level = 10
> bacula-dir: dird_conf.c:1958-0 runscript cmd=prune expired volume yes type=@
> bacula-dir: dird_conf.c:1958-0 runscript cmd=/usr/libexec/bacula/make_catalog_backup.pl MyCatalog type=|
> bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate storage=FileStorage pool=Files type=@
> bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate storage=CatalogueStorage pool=Catalogues type=@
> bacula-dir: dird_conf.c:1958-0 runscript cmd=/usr/libexec/bacula/delete_catalogue_backup type=|
> bacula-dir: dird.c:969-0 Could not open Catalog "MyCatalog", database "bacula".
> bacula-dir: dird.c:974-0 mysql.c:265 Unable to connect to MySQL server.
> Database=bacula User=bacula
> MySQL connect failed either server not running or your authorization is incorrect.
> 05-mar 11:58 bacula-dir ERROR TERMINATION
> Please correct configuration file: bacula-dir.conf
> [root@Erik-PC bacula]#
>
> I don't see this on the old machine which works flawlessly.
>
> I do hope someone will be able to pinpoint what the problem is or
> perhaps give me a clue on how to diagnose it.
>
> Thanks in advance,
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Bacula-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>


Hi,

maybe you forgot to allow the ip from the new bacula server in your
mysql db server.

greets

juergen

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
On 2017-03-05 at 17:35:10 J. Echter wrote:

> Am 05.03.2017 um 12:06 schrieb Erik P. Olsen:
> > I have retired my old desktop and moved my programmes including
> > bacula to my laptop. Since I have been running bacula successfully
> > for many years I thought it would be piece of cake to install
> > bacula on this other box. But it turned out not to be so.
> >
> > I am running linux with fedora 25 on both machines, and I've tried
> > to keep the new installation as close as possible to the old.
> >
> > Bacula is installed from the dnf repository on both machines and is
> > version 7.4.5-1. I am aware that the bacula files from fedora's
> > repository are "infected" with postgresql, so I have changed them to
> > default to mysql. To the problem:
> >
> > bacula-dir, bacula-fd and bacula-sd start correctly but testing the
> > directory yields:
> >
> > [root@Erik-PC bacula]# bacula-dir -t -d10 -c bacula-dir.conf
> > bacula-dir: dird.c:208-0 Debug level = 10
> > bacula-dir: dird_conf.c:1958-0 runscript cmd=prune expired volume
> > yes type=@ bacula-dir: dird_conf.c:1958-0 runscript
> > cmd=/usr/libexec/bacula/make_catalog_backup.pl MyCatalog type=|
> > bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate
> > storage=FileStorage pool=Files type=@ bacula-dir:
> > dird_conf.c:1958-0 runscript cmd=truncate storage=CatalogueStorage
> > pool=Catalogues type=@ bacula-dir: dird_conf.c:1958-0 runscript
> > cmd=/usr/libexec/bacula/delete_catalogue_backup type=| bacula-dir:
> > dird.c:969-0 Could not open Catalog "MyCatalog", database "bacula".
> > bacula-dir: dird.c:974-0 mysql.c:265 Unable to connect to MySQL
> > server. Database=bacula User=bacula MySQL connect failed either
> > server not running or your authorization is incorrect. 05-mar 11:58
> > bacula-dir ERROR TERMINATION Please correct configuration file:
> > bacula-dir.conf [root@Erik-PC bacula]#
> >
> > I don't see this on the old machine which works flawlessly.
> >
> > I do hope someone will be able to pinpoint what the problem is or
> > perhaps give me a clue on how to diagnose it.
> >
> > Thanks in advance,
> >
> > ------------------------------------------------------------------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Bacula-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/bacula-users
> >  
>
>
> Hi,
>
> maybe you forgot to allow the ip from the new bacula server in your
> mysql db server.
>
> greets
>
> juergen
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Bacula-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bacula-users

 
That's interesting. I assume you mean DirAddress, FDAddress and
SDAddress. I don't specify them since the manual says they are optional
and I haven't had any problem so far by omitting them. Do you mean to
say that they are now mandatory? Or are you referring to something else?

--
Erik

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
In reply to this post by Kern Sibbald
Hello Kern,

I have main.pdf downloaded and I believe I have followed the various
steps in phase II to the letter. I have come to the point where I need
some tools to diagnose what is wrong. I am pretty sure that the problem
is due to some sort of security settings in the mysql database but I
am not able to see what that could and the manual has not been to any
help in that respect

--
Erik


On 2017-03-05 at 15:18:51 Kern Sibbald wrote:

> Hello Erik,
>
> It is pretty clear from the output that Bacula is unable to connect to
> the MySQL server.  I recommend you either download the manual or use
> the online html version from bacula.org and go to the chapter on
> setting up the MySQL server.  This gives you a number of steps to
> work through until hopefully the connection with the server will work.
>
> Best regards,
> Kern
>
> On 03/05/2017 12:06 PM, Erik P. Olsen wrote:
> > I have retired my old desktop and moved my programmes including
> > bacula to my laptop. Since I have been running bacula successfully
> > for many years I thought it would be piece of cake to install
> > bacula on this other box. But it turned out not to be so.
> >
> > I am running linux with fedora 25 on both machines, and I've tried
> > to keep the new installation as close as possible to the old.
> >
> > Bacula is installed from the dnf repository on both machines and is
> > version 7.4.5-1. I am aware that the bacula files from fedora's
> > repository are "infected" with postgresql, so I have changed them to
> > default to mysql. To the problem:
> >
> > bacula-dir, bacula-fd and bacula-sd start correctly but testing the
> > directory yields:
> >
> > [root@Erik-PC bacula]# bacula-dir -t -d10 -c bacula-dir.conf
> > bacula-dir: dird.c:208-0 Debug level = 10
> > bacula-dir: dird_conf.c:1958-0 runscript cmd=prune expired volume
> > yes type=@ bacula-dir: dird_conf.c:1958-0 runscript
> > cmd=/usr/libexec/bacula/make_catalog_backup.pl MyCatalog type=|
> > bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate
> > storage=FileStorage pool=Files type=@ bacula-dir:
> > dird_conf.c:1958-0 runscript cmd=truncate storage=CatalogueStorage
> > pool=Catalogues type=@ bacula-dir: dird_conf.c:1958-0 runscript
> > cmd=/usr/libexec/bacula/delete_catalogue_backup type=| bacula-dir:
> > dird.c:969-0 Could not open Catalog "MyCatalog", database "bacula".
> > bacula-dir: dird.c:974-0 mysql.c:265 Unable to connect to MySQL
> > server. Database=bacula User=bacula MySQL connect failed either
> > server not running or your authorization is incorrect. 05-mar 11:58
> > bacula-dir ERROR TERMINATION Please correct configuration file:
> > bacula-dir.conf [root@Erik-PC bacula]#
> >
> > I don't see this on the old machine which works flawlessly.
> >
> > I do hope someone will be able to pinpoint what the problem is or
> > perhaps give me a clue on how to diagnose it.
> >
> > Thanks in advance,
> >
> > ------------------------------------------------------------------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Bacula-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/bacula-users
> >  
>

 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Josip Deanovic
On Sunday 2017-03-05 19:53:26 Erik P. Olsen wrote:
> Hello Kern,
>
> I have main.pdf downloaded and I believe I have followed the various
> steps in phase II to the letter. I have come to the point where I need
> some tools to diagnose what is wrong. I am pretty sure that the problem
> is due to some sort of security settings in the mysql database but I
> am not able to see what that could and the manual has not been to any
> help in that respect

When in doubt always try to connect manually using the credentials
you plan to use from bacula-dir in order to rule out incorrect database
or network setup.

For example, from the bacula-dir server you can try something like this:
 mysql -h <dbhost> -u <dbuser> -p <dbname>

The command above should prompt you for a password and if you are
able to connect then there is nothing wrong with the mysql setup.
Otherwise you need to setup your mysql database properly first.

Regards

--
Josip Deanovic

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
On 2017-03-05 at 20:24:15 Josip Deanovic wrote:

> On Sunday 2017-03-05 19:53:26 Erik P. Olsen wrote:
> > Hello Kern,
> >
> > I have main.pdf downloaded and I believe I have followed the various
> > steps in phase II to the letter. I have come to the point where I
> > need some tools to diagnose what is wrong. I am pretty sure that
> > the problem is due to some sort of security settings in the mysql
> > database but I am not able to see what that could and the manual
> > has not been to any help in that respect  
>
> When in doubt always try to connect manually using the credentials
> you plan to use from bacula-dir in order to rule out incorrect
> database or network setup.
>
> For example, from the bacula-dir server you can try something like
> this: mysql -h <dbhost> -u <dbuser> -p <dbname>
>
> The command above should prompt you for a password and if you are
> able to connect then there is nothing wrong with the mysql setup.
> Otherwise you need to setup your mysql database properly first.
>
> Regards
>

Thanks for your advice which I tried both with and without arguments
and it apparently connected correctly - at least I got a welcome
message from mariadb. So I guess it is safe to assume that the mysql
database is properly setup.

--
Erik


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
On 2017-03-05 at 21:10:58 Erik P. Olsen wrote:

> On 2017-03-05 at 20:24:15 Josip Deanovic wrote:
>
> > On Sunday 2017-03-05 19:53:26 Erik P. Olsen wrote:  
> > > Hello Kern,
> > >
> > > I have main.pdf downloaded and I believe I have followed the
> > > various steps in phase II to the letter. I have come to the point
> > > where I need some tools to diagnose what is wrong. I am pretty
> > > sure that the problem is due to some sort of security settings in
> > > the mysql database but I am not able to see what that could and
> > > the manual has not been to any help in that respect    
> >
> > When in doubt always try to connect manually using the credentials
> > you plan to use from bacula-dir in order to rule out incorrect
> > database or network setup.
> >
> > For example, from the bacula-dir server you can try something like
> > this: mysql -h <dbhost> -u <dbuser> -p <dbname>
> >
> > The command above should prompt you for a password and if you are
> > able to connect then there is nothing wrong with the mysql setup.
> > Otherwise you need to setup your mysql database properly first.
> >
> > Regards
> >  
>
> Thanks for your advice which I tried both with and without arguments
> and it apparently connected correctly - at least I got a welcome
> message from mariadb. So I guess it is safe to assume that the mysql
> database is properly setup.
>

I have tried again. Dropped the tables and made (make) them again just
to be sure there is nothing incorrect in the tables. Testing bacula-dir
gave this time:

[root@Erik-PC bacula]# bacula-dir -t -d100 -c bacula-dir.conf
bacula-dir: dird.c:208-0 Debug level = 100
bacula-dir: address_conf.c:274-0 Initaddr 0.0.0.0:9101
bacula-dir: dird_conf.c:1958-0 runscript cmd=prune expired volume yes
type=@ bacula-dir: dird_conf.c:1958-0 runscript
cmd=/usr/libexec/bacula/make_catalog_backup.pl MyCatalog type=|
bacula-dir: dird_conf.c:1958-0 runscript cmd=truncate
storage=FileStorage pool=Files type=@ bacula-dir: dird_conf.c:1958-0
runscript cmd=truncate storage=CatalogueStorage pool=Catalogues type=@
bacula-dir: dird_conf.c:1958-0 runscript
cmd=/usr/libexec/bacula/delete_catalogue_backup type=| bacula-dir:
dir_plugins.c:151-0 Load Director plugins bacula-dir:
dir_plugins.c:153-0 No Director plugin directory! bacula-dir:
mysql.c:119-0 db_init_database first time bacula-dir: mysql.c:218-0
mysql_init done bacula-dir: mysql.c:257-0 mysql_real_connect done
bacula-dir: mysql.c:259-0 db_user=bacula db_name=bacula db_password=
bacula-dir: mysql.c:269-0 Error 1044 (42000): Access denied for user
''@'localhost' to database 'bacula' bacula-dir: dird.c:969-0 Could not
open Catalog "MyCatalog", database "bacula". bacula-dir: dird.c:974-0
mysql.c:265 Unable to connect to MySQL server. Database=bacula
User=bacula MySQL connect failed either server not running or your
authorization is incorrect. bacula-dir: mysql.c:319-0 closedb ref=0
connected=0 db=0 05-mar 22:35 bacula-dir ERROR TERMINATION Please
correct configuration file: bacula-dir.conf

I noticed "Access denied for user ''@'localhost' ...". Where does this
user come from? Isn't that the reason for the failures and if it's
true what can I do to correct it? Also "Initaddr 0.0.0.0:9101" looked
strange.

--
Erik




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Kern Sibbald
In reply to this post by Erik P. Olsen-3
Hello Erik,

Yes, the manual assumes you did a standard rpm or deb install without
Selinux.  If you did anything else, either you are on your own, or you
must come back to a standard install.

In any case, good luck.

Best regards,
Kern

On 03/05/2017 07:53 PM, Erik P. Olsen wrote:
> Hello Kern,
>
> I have main.pdf downloaded and I believe I have followed the various
> steps in phase II to the letter. I have come to the point where I need
> some tools to diagnose what is wrong. I am pretty sure that the problem
> is due to some sort of security settings in the mysql database but I
> am not able to see what that could and the manual has not been to any
> help in that respect
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Kern Sibbald
In reply to this post by Erik P. Olsen-3
Well, MariaDB is not MySQL -- there are a number of subtile difficulties
I had when I tried it.  One of the most common problems if you have two
DBs (typically the case in Postgresql) is that the socket port, which is
used by default, is different from the one that Bacula expect.

Best regards,
Kern

On 03/05/2017 09:10 PM, Erik P. Olsen wrote:

> On 2017-03-05 at 20:24:15 Josip Deanovic wrote:
>
>> On Sunday 2017-03-05 19:53:26 Erik P. Olsen wrote:
>>> Hello Kern,
>>>
>>> I have main.pdf downloaded and I believe I have followed the various
>>> steps in phase II to the letter. I have come to the point where I
>>> need some tools to diagnose what is wrong. I am pretty sure that
>>> the problem is due to some sort of security settings in the mysql
>>> database but I am not able to see what that could and the manual
>>> has not been to any help in that respect  
>> When in doubt always try to connect manually using the credentials
>> you plan to use from bacula-dir in order to rule out incorrect
>> database or network setup.
>>
>> For example, from the bacula-dir server you can try something like
>> this: mysql -h <dbhost> -u <dbuser> -p <dbname>
>>
>> The command above should prompt you for a password and if you are
>> able to connect then there is nothing wrong with the mysql setup.
>> Otherwise you need to setup your mysql database properly first.
>>
>> Regards
>>
> Thanks for your advice which I tried both with and without arguments
> and it apparently connected correctly - at least I got a welcome
> message from mariadb. So I guess it is safe to assume that the mysql
> database is properly setup.
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
In reply to this post by Kern Sibbald
On 2017-03-06 at 09:48:40 Kern Sibbald wrote:

> Yes, the manual assumes you did a standard rpm or deb install without
> Selinux.  If you did anything else, either you are on your own, or you
> must come back to a standard install.
 
And if I happen to install without selinux what advice do I get from
this message?

--
Regards,
Erik P. Olsen, M.Sc. EE
Solsortvej 30
DK-2000 Frederiksberg
Denmark

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Josip Deanovic
On Monday 2017-03-06 10:57:03 Erik P. Olsen wrote:
> On 2017-03-06 at 09:48:40 Kern Sibbald wrote:
> > Yes, the manual assumes you did a standard rpm or deb install without
> > Selinux.  If you did anything else, either you are on your own, or you
> > must come back to a standard install.
>
>  
> And if I happen to install without selinux what advice do I get from
> this message?

Are you using selinux?

If you do, I would suggest to turn it off (not just because of bacula).
It's unreliable, too complex and almost certainly will make more harm
than good. It will also make you think that your system substantially
more secure.

If you really need security enhanced system there are other solutions
that have proven themselves to actually make system more secure and
they are often less complex and easier to maintain but I don't want
to go into it because it would leave the scope of this mailing list.


Anyways, if you want to continue with selinux you will have to
learn how it works, how to manage it and how to debug it in order
to understand how your bacula processes relate to different files
and then you have to setup a proper selinux context for that files.
I believe it's possible to find many articles on this subject on the
internet.


--
Josip Deanovic

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
On 2017-03-06 at 11:27:20 Josip Deanovic wrote:

> On Monday 2017-03-06 10:57:03 Erik P. Olsen wrote:
> > On 2017-03-06 at 09:48:40 Kern Sibbald wrote:  
> > > Yes, the manual assumes you did a standard rpm or deb install
> > > without Selinux.  If you did anything else, either you are on
> > > your own, or you must come back to a standard install.  
> >
> >  
> > And if I happen to install without selinux what advice do I get from
> > this message?  
>
> Are you using selinux?
>
> If you do, I would suggest to turn it off (not just because of
> bacula). It's unreliable, too complex and almost certainly will make
> more harm than good. It will also make you think that your system
> substantially more secure.
>
> If you really need security enhanced system there are other solutions
> that have proven themselves to actually make system more secure and
> they are often less complex and easier to maintain but I don't want
> to go into it because it would leave the scope of this mailing list.
>
>
> Anyways, if you want to continue with selinux you will have to
> learn how it works, how to manage it and how to debug it in order
> to understand how your bacula processes relate to different files
> and then you have to setup a proper selinux context for that files.
> I believe it's possible to find many articles on this subject on the
> internet.
>
>

This was something Kern brought up out of the blue. I need no advice on
selinux. Read my previous messages about my bacula problems. If you can
offer advice on these problems I would be more than happy. And contrary
to what Kern thinks I do read manuals.

--
Venlig hilsen,
Erik P. Olsen
Solsortvej 30
2000 Frederiksberg

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

francisco javier funes nieto
Hi Erik,

Can you post the Catalog definition in your bacula-dir.conf ? 
Or check:

dbname = bacula
dbuser = bacula
dbpassword = the password for user bacula in MySQL server 

The error you show above makes me think about the username it's not configured in your bacula-dir.conf, and Bacula it's trying to connect to the Catalog without username. 

Maybe it's a simple question not related with SELinux.

Best Regards,

J.



2017-03-06 12:42 GMT+01:00 Erik P. Olsen <[hidden email]>:
On 2017-03-06 at 11:27:20 Josip Deanovic wrote:

> On Monday 2017-03-06 10:57:03 Erik P. Olsen wrote:
> > On 2017-03-06 at 09:48:40 Kern Sibbald wrote:
> > > Yes, the manual assumes you did a standard rpm or deb install
> > > without Selinux.  If you did anything else, either you are on
> > > your own, or you must come back to a standard install.
> >
> >
> > And if I happen to install without selinux what advice do I get from
> > this message?
>
> Are you using selinux?
>
> If you do, I would suggest to turn it off (not just because of
> bacula). It's unreliable, too complex and almost certainly will make
> more harm than good. It will also make you think that your system
> substantially more secure.
>
> If you really need security enhanced system there are other solutions
> that have proven themselves to actually make system more secure and
> they are often less complex and easier to maintain but I don't want
> to go into it because it would leave the scope of this mailing list.
>
>
> Anyways, if you want to continue with selinux you will have to
> learn how it works, how to manage it and how to debug it in order
> to understand how your bacula processes relate to different files
> and then you have to setup a proper selinux context for that files.
> I believe it's possible to find many articles on this subject on the
> internet.
>
>

This was something Kern brought up out of the blue. I need no advice on
selinux. Read my previous messages about my bacula problems. If you can
offer advice on these problems I would be more than happy. And contrary
to what Kern thinks I do read manuals.

--
Venlig hilsen,
Erik P. Olsen
Solsortvej 30
2000 Frederiksberg

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users



--
_____________________________________________

Francisco Javier Funes Nieto [[hidden email]]
CANONIGOS
Servicios Informáticos para PYMES.
Cl. Cruz 2, 1º Oficina 7
Tlf: 958.536759 / 661134556
Fax: 958.521354
GRANADA - 18002

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
On 2017-03-06 at 12:59:11 Francisco Javier Funes Nieto wrote:
Hi Francisco,

This is my catalogue definition:

#
# Generic catalog service
#
Catalog {
  Name = MyCatalog
  dbname = "bacula"; dbuser = "bacula"; dbpassword = ""
}

I don't think there is any dbpassword. I tried to copy as much as
possible from my old machine which does not use dbpassword and my tests
for mysql connect seems to indicate that dbpassword is not needed.

It's definitely not a selinux problem.

--
Regards,
Erik P. Olsen, M.Sc. EE
Solsortvej 30
DK-2000 Frederiksberg
Denmark

> Hi Erik,
>
> Can you post the Catalog definition in your bacula-dir.conf ?
> Or check:
>
> dbname = bacula
> dbuser = bacula
> dbpassword = the password for user bacula in MySQL server
>
> The error you show above makes me think about the username it's not
> configured in your bacula-dir.conf, and Bacula it's trying to connect
> to the Catalog without username.
>
> Maybe it's a simple question not related with SELinux.
>
> Best Regards,
>
> J.
>
>
>
> 2017-03-06 12:42 GMT+01:00 Erik P. Olsen <[hidden email]>:
>
> > On 2017-03-06 at 11:27:20 Josip Deanovic wrote:
> >  
> > > On Monday 2017-03-06 10:57:03 Erik P. Olsen wrote:  
> > > > On 2017-03-06 at 09:48:40 Kern Sibbald wrote:  
> > > > > Yes, the manual assumes you did a standard rpm or deb install
> > > > > without Selinux.  If you did anything else, either you are on
> > > > > your own, or you must come back to a standard install.  
> > > >
> > > >
> > > > And if I happen to install without selinux what advice do I get
> > > > from this message?  
> > >
> > > Are you using selinux?
> > >
> > > If you do, I would suggest to turn it off (not just because of
> > > bacula). It's unreliable, too complex and almost certainly will
> > > make more harm than good. It will also make you think that your
> > > system substantially more secure.
> > >
> > > If you really need security enhanced system there are other
> > > solutions that have proven themselves to actually make system
> > > more secure and they are often less complex and easier to
> > > maintain but I don't want to go into it because it would leave
> > > the scope of this mailing list.
> > >
> > >
> > > Anyways, if you want to continue with selinux you will have to
> > > learn how it works, how to manage it and how to debug it in order
> > > to understand how your bacula processes relate to different files
> > > and then you have to setup a proper selinux context for that
> > > files. I believe it's possible to find many articles on this
> > > subject on the internet.
> > >
> > >  
> >
> > This was something Kern brought up out of the blue. I need no
> > advice on selinux. Read my previous messages about my bacula
> > problems. If you can offer advice on these problems I would be more
> > than happy. And contrary to what Kern thinks I do read manuals.
> >
> > --
> > Venlig hilsen,
> > Erik P. Olsen
> > Solsortvej 30
> > 2000 Frederiksberg
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Bacula-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/bacula-users
> >  
>
>
>

 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Gary R. Schmidt-3
In reply to this post by Erik P. Olsen-3
On 06/03/2017 08:51, Erik P. Olsen wrote:
[SNIP]

> bacula-dir: mysql.c:259-0 db_user=bacula db_name=bacula db_password=
> bacula-dir: mysql.c:269-0 Error 1044 (42000): Access denied for user
> ''@'localhost' to database 'bacula' bacula-dir: dird.c:969-0 Could not
> open Catalog "MyCatalog", database "bacula". bacula-dir: dird.c:974-0
> mysql.c:265 Unable to connect to MySQL server. Database=bacula
> User=bacula MySQL connect failed either server not running or your
> authorization is incorrect. bacula-dir: mysql.c:319-0 closedb ref=0
> connected=0 db=0 05-mar 22:35 bacula-dir ERROR TERMINATION Please
> correct configuration file: bacula-dir.conf
>
> I noticed "Access denied for user ''@'localhost' ...". Where does this
> user come from? Isn't that the reason for the failures and if it's
> true what can I do to correct it? Also "Initaddr 0.0.0.0:9101" looked
> strange.
>
This looks to be your problem.

I suspect that the access privileges for the user "bacula" to the
database "bacula" have not been set.

Later on you mention that you are using MariaDB, I presume they haven't
changed things that much that the standard settings for MySQL don't work.

I can't recall what they should be, it is in the documentation, that
much I recall.

The Initaddr is listening on 9101, if bacula-dir doesn't listen for
connections nothing happens.

        Cheers,
                Gary B-)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

francisco javier funes nieto
In reply to this post by Erik P. Olsen-3
To delimite the problem:

Check MySQL/MariaDB it's running in the host. 

ps axu|grep mysql
 ps axu|grep mysql
root     12832  0.0  0.0  23068  3456 ?        S    mar01   0:00 /bin/bash /usr/bin/mysqld_safe
mysql    12967  0.1  0.9 613220 76684 ?        Sl   mar01  10:49 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306


Check the username Bacula exists in the Catalog Server (on mysql prompt = use mysql; select * from user where User='bacula';)

Check the username Bacula has the right permissions to access the bacula database. 

If you run the make_bacula_database, make_bacula_tables and grant_bacula_privileges scripts maybe would be safe to set a password to the user bacula and configure it into the bacula-dir.conf too. 

J.
 

2017-03-06 13:13 GMT+01:00 Erik P. Olsen <[hidden email]>:
On 2017-03-06 at 12:59:11 Francisco Javier Funes Nieto wrote:
Hi Francisco,

This is my catalogue definition:

#
# Generic catalog service
#
Catalog {
  Name = MyCatalog
  dbname = "bacula"; dbuser = "bacula"; dbpassword = ""
}

I don't think there is any dbpassword. I tried to copy as much as
possible from my old machine which does not use dbpassword and my tests
for mysql connect seems to indicate that dbpassword is not needed.

It's definitely not a selinux problem.

--
Regards,
Erik P. Olsen, M.Sc. EE
Solsortvej 30
DK-2000 Frederiksberg
Denmark

> Hi Erik,
>
> Can you post the Catalog definition in your bacula-dir.conf ?
> Or check:
>
> dbname = bacula
> dbuser = bacula
> dbpassword = the password for user bacula in MySQL server
>
> The error you show above makes me think about the username it's not
> configured in your bacula-dir.conf, and Bacula it's trying to connect
> to the Catalog without username.
>
> Maybe it's a simple question not related with SELinux.
>
> Best Regards,
>
> J.
>
>
>
> 2017-03-06 12:42 GMT+01:00 Erik P. Olsen <[hidden email]>:
>
> > On 2017-03-06 at 11:27:20 Josip Deanovic wrote:
> >
> > > On Monday 2017-03-06 10:57:03 Erik P. Olsen wrote:
> > > > On 2017-03-06 at 09:48:40 Kern Sibbald wrote:
> > > > > Yes, the manual assumes you did a standard rpm or deb install
> > > > > without Selinux.  If you did anything else, either you are on
> > > > > your own, or you must come back to a standard install.
> > > >
> > > >
> > > > And if I happen to install without selinux what advice do I get
> > > > from this message?
> > >
> > > Are you using selinux?
> > >
> > > If you do, I would suggest to turn it off (not just because of
> > > bacula). It's unreliable, too complex and almost certainly will
> > > make more harm than good. It will also make you think that your
> > > system substantially more secure.
> > >
> > > If you really need security enhanced system there are other
> > > solutions that have proven themselves to actually make system
> > > more secure and they are often less complex and easier to
> > > maintain but I don't want to go into it because it would leave
> > > the scope of this mailing list.
> > >
> > >
> > > Anyways, if you want to continue with selinux you will have to
> > > learn how it works, how to manage it and how to debug it in order
> > > to understand how your bacula processes relate to different files
> > > and then you have to setup a proper selinux context for that
> > > files. I believe it's possible to find many articles on this
> > > subject on the internet.
> > >
> > >
> >
> > This was something Kern brought up out of the blue. I need no
> > advice on selinux. Read my previous messages about my bacula
> > problems. If you can offer advice on these problems I would be more
> > than happy. And contrary to what Kern thinks I do read manuals.
> >
> > --
> > Venlig hilsen,
> > Erik P. Olsen
> > Solsortvej 30
> > 2000 Frederiksberg
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Bacula-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/bacula-users
> >
>
>
>





--
_____________________________________________

Francisco Javier Funes Nieto [[hidden email]]
CANONIGOS
Servicios Informáticos para PYMES.
Cl. Cruz 2, 1º Oficina 7
Tlf: 958.536759 / 661134556
Fax: 958.521354
GRANADA - 18002

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Simone Caronni-2
In reply to this post by Gary R. Schmidt-3
Hi Erik,

On Mon, Mar 6, 2017 at 1:26 PM, Gary R. Schmidt <[hidden email]> wrote:
On 06/03/2017 08:51, Erik P. Olsen wrote:
> I noticed "Access denied for user ''@'localhost' ...". Where does this
> user come from? Isn't that the reason for the failures and if it's
> true what can I do to correct it? Also "Initaddr 0.0.0.0:9101" looked
> strange.
>
This looks to be your problem.

I suspect that the access privileges for the user "bacula" to the
database "bacula" have not been set.

Later on you mention that you are using MariaDB, I presume they haven't
changed things that much that the standard settings for MySQL don't work.

I can't recall what they should be, it is in the documentation, that
much I recall.

The Initaddr is listening on 9101, if bacula-dir doesn't listen for
connections nothing happens.

There are super short tutorials inside the bacula-common package that you can use to bring up a quick installation with a client, director and storage daemons:

$ rpm -qd bacula-common
/usr/share/doc/bacula-common/README.Redhat
/usr/share/doc/bacula-common/quickstart_mysql.txt
/usr/share/doc/bacula-common/quickstart_postgresql.txt
/usr/share/doc/bacula-common/quickstart_sqlite3.txt

You can even do copy/paste and it will just work. Inside there is also the library switching for the director backend through update-alternatives.

There is no need to disable SELinux, the Bacula daemon has policies for all the daemons, behaviours and file system contexts since many years now:

# semanage fcontext -l | grep bacula
/bacula(/.*)?                                      all files          system_u:object_r:bacula_store_t:s0 
/etc/bacula.*                                      all files          system_u:object_r:bacula_etc_t:s0 
/etc/rc\.d/init\.d/bacula.*                        regular file       system_u:object_r:bacula_initrc_exec_t:s0 
/usr/sbin/bacula.*                                 regular file       system_u:object_r:bacula_exec_t:s0 
/usr/sbin/bat                                      regular file       system_u:object_r:bacula_admin_exec_t:s0 
/usr/sbin/bconsole                                 regular file       system_u:object_r:bacula_admin_exec_t:s0 
/var/bacula(/.*)?                                  all files          system_u:object_r:bacula_store_t:s0 
/var/lib/bacula.*                                  all files          system_u:object_r:bacula_var_lib_t:s0 
/var/log/bacula.*                                  all files          system_u:object_r:bacula_log_t:s0 
/var/run/bacula.*                                  regular file       system_u:object_r:bacula_var_run_t:s0 
/var/spool/bacula.*                                all files          system_u:object_r:bacula_spool_t:s0 
/var/spool/bacula/log(/.*)?                        all files          system_u:object_r:var_log_t:s0

There is no need to turn off SELinux and is actually not recommended. Much like turning off your firewall and enabling password-less logins. If SELinux is denying you something because you used non-standard RHEL/Fedora locations, just add the appropriate contexts to your system (semanage fcontext -a).

Regards,
--Simone



--
You cannot discover new oceans unless you have the courage to lose sight of the shore (R. W. Emerson).

http://xkcd.com/229/
http://negativo17.org/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Josip Deanovic
In reply to this post by Erik P. Olsen-3
On Monday 2017-03-06 12:42:13 Erik P. Olsen wrote:
> This was something Kern brought up out of the blue. I need no advice on
> selinux. Read my previous messages about my bacula problems. If you can
> offer advice on these problems I would be more than happy. And contrary
> to what Kern thinks I do read manuals.

Sorry Erik, I didn't meant to offend you or anything like that.
It wasn't clear to me if you are using selinux or not and selinux
is often source of many problems related to access to some files
or services.

That's why I asked about selinux and I guess that Kern brought it up
because of the same reasons.

--
Josip Deanovic

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Josip Deanovic
In reply to this post by Erik P. Olsen-3
On Sunday 2017-03-05 21:10:58 Erik P. Olsen wrote:

> On 2017-03-05 at 20:24:15 Josip Deanovic wrote:
> > When in doubt always try to connect manually using the credentials
> > you plan to use from bacula-dir in order to rule out incorrect
> > database or network setup.
> >
> > For example, from the bacula-dir server you can try something like
> > this: mysql -h <dbhost> -u <dbuser> -p <dbname>
> >
> > The command above should prompt you for a password and if you are
> > able to connect then there is nothing wrong with the mysql setup.
> > Otherwise you need to setup your mysql database properly first.
> >
> > Regards
>
> Thanks for your advice which I tried both with and without arguments
> and it apparently connected correctly - at least I got a welcome
> message from mariadb. So I guess it is safe to assume that the mysql
> database is properly setup.

I have few more ideas where you could look for the solution.

You might already know this but I am going to mention it anyway.
Mysql makes difference between localhost and 127.0.0.1.
The first one (localhost) instructs the client to connect to the
database through a unix socket while the other one (127.0.0.1) will
expect mysql to bind to 127.0.0.1 IP and some port (default mysql
port is 3306).

Also, from your first post and debugging messages I am not 100%
sure that your bacula supports mysql.

I would use these two steps to check that:
1. ldd <path_to_your_bacula-dir_binary>
   check if you can find something like libmysqlclient in the
   output.

2. Check if your /usr/lib64/libbaccats.so symlink points to the
   correct library (mysql and not postgres). Modern distributions
   are usually using alternatives(8) to manage this.



--
Josip Deanovic

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
1234
Loading...