bareos-dir -t and postgresql error and discussion about workaround

2,157 views
Skip to first unread message

Oliver Hertwig

unread,
May 29, 2013, 8:07:20 AM5/29/13
to bareos...@googlegroups.com
Hi all,

I'm neither a bareos nor postgres expert, so please excuse me if my issue/question is a noob one (although I searched the docs and the web before posting here).

I'm on bareos 12.4.3-1 on Ubuntu Server 12.04.2 LTS with postgres 9.1 as backend. Installation/configuration was done following the guidelines given in the quickstart section on the bareos website. After initial setup and first start of bareos I wanted to check the config files via bareos-dir -t etc.
bareos-dir -t threw an error and complained about the connection to the postgres db "bareos":

root@stokes:~# bareos-dir -t
bareos-dir: dird.c:1088-0 Could not open Catalog "MyCatalog", database "bareos".
bareos-dir: dird.c:1093-0 postgresql.c:238 Unable to connect to PostgreSQL server. Database=bareos User=bareos
Possible causes: SQL server not running; password incorrect; max_connections exceeded.
29-May 12:28 bareos-dir ERROR TERMINATION
Please correct configuration file: bareos-dir.conf

bareos-dir.conf:
...
dbdriver = "postgresql"
dbname = "bareos"
dbuser = "bareos"
dbpassword = ""
...

Apparently password is not set.

Using psql as user portgres: "psql -d bareos --username bareos" complained about failing to peer authenticate.

User bareos is existing but not allowed to log in interactively, seems to be OK:

/etc/shadow
bareos:*:15847:0:99999:7:::

So I altered pg_hba.conf:

# "local" is for Unix domain socket connections only
local bareos bareos trust
local all all peer

to allow bareos a unconditional login to the database. Now bareos-dir -t works as expected.

Is this issue in any way related to my install/configure procedure? I assume that it is because I can't find any bareos related references in the web. Additionally, is the workaround legit?

Many thanks for hints and/or links to learn more about this issue.

Oliver

lst_...@kwsoft.de

unread,
May 29, 2013, 8:42:48 AM5/29/13
to bareos...@googlegroups.com

Zitat von Oliver Hertwig <oher...@gmail.com>:
Hello,

Postgres trust local connections if the OS user is the same as the
desired DB user. This is set by the "peer" authentication in
pg_hba.conf. So if you check "bareos-dir -t" as user "bareos" it would
have worked, and that is the user bareos backup is running as. If you
need to access the database as bareos db-user from another OS user you
have to set a db password for the bareos user.

Regards

Andreas


Oliver Hertwig

unread,
May 29, 2013, 8:53:10 AM5/29/13
to bareos...@googlegroups.com, lst_...@kwsoft.de
Dang! I expected that this issue must have something to do with missing the forest for the trees!

Thanks a lot!

Cheers

Reply all
Reply to author
Forward
0 new messages