gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Problems using gm-backup_database on debian, newest g


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Problems using gm-backup_database on debian, newest gnumed server/client
Date: Fri, 13 May 2011 11:42:40 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Marc,

thanks for you research and patch !

> I got mails on my new-setup-debian-testing-gnumed-server because of
> uncompleted automatical backups of the database.
>
> it shows an error processing sanity-check in the gm-backup_database script.

What did those messages say, exactly ?

Perhaps there is some underlying bug that we need to correct.

> I corrected this (mainly some " instead of ' because of
> variable-expansion in the sanity-check function) --> appendix

This is what you suggest to do:

> # sanity check
> if ! su -c "psql -U postgres -t -l -p ${GM_PORT} -l postgres" | grep -q 
> "^[[:space:]]*${GM_DATABASE}" ; then

However, there's a problem with that. By moving the " after
the //-l postgres// you are effectively taking away the "-l
postgres" from the "su" command (where it meant:

        su to the -l(ogin) "postgres"

) and adding it to the "psql" command (where it now means:

        duplicate the -l(ist) option and try connecting to the
        "postgres" database

). The su now means:

        "su to the user root"

Root then tries to connect to the database "postgres" as
(-U)ser postgres which may or may not succeed depending on
the system setup.

> another problem was to automaticly pass the password for gm-dbo
> 
> I put it in /root/.pgpass (localhost:5432:gnumed*:gm-dbo:secret)

I'm sure you chmod'ed that to 0600.

Can you (as root)

        psql -U gm-dbo -d gnumed_vXX

?

> and /var/lib/postgres/.pgpass --> no working solution

In fact, that line above will not work. It must be:

        localhost:5432:*:gm-dbo:secret

This is what the PG docs say:

        Each of the first four fields can be a literal value, or
        *, which matches anything

So it's not a regex but rather either or.

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]