Martin Simmons wrote:
On Wed, 08 Nov 2006 00:16:09 -0800, G Armour Van Horn said:
            
Scott, I hope you don't mind but I'm taking this back to the list, I 
really would like as many folks looking at this as possible, and if we 
figure it out the solution should end up in the list archive.

Scott Simpson wrote:

    
On Tuesday 07 November 2006 11:58 am, you wrote:
 

      
All of that is working perfectly with only one exception. When I did the
"psql bacula" the first line in response was
   could not change directory to "/root"
   

        
What is the home directory set to for postgres in /etc/passwd? Mine 
is /var/lib/postgresql (on Ubuntu).
.
 

      
[EMAIL PROTECTED] ~]# cat /etc/passwd | grep postg
postgres:x:26:26:PostgreSQL Server:/var/lib/pgsql:/bin/bash

And, since I've seen "/root" pop up in several of the errors:

[EMAIL PROTECTED] ~]# cat /etc/passwd | grep root
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin

If I try to start the director I get this:

[EMAIL PROTECTED] bacula]# ./bacula-ctl-dir start
Starting the Bacula Director daemon
07-Nov 23:52 bacula-dir:  Fatal error: Could not open Catalog 
"MyCatalog", database "bacula".
07-Nov 23:52 bacula-dir:  Fatal error: postgresql.c:168 Unable to 
connect to PostgreSQL server.
Database=bacula User=bacula
It is probably not running or your password is incorrect.
07-Nov 23:52 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf

Note that it's trying to run as bacula. Earlier you suggested I do "psql 
bacula" as user postgresql, but I see here that it's not trying to run 
as user postgresql. So I tried to do that from that account, but "su 
bacula" was disallowed as the user doesn't have shell access:

[EMAIL PROTECTED] bacula]# cat /etc/passwd | grep bacula
bacula:x:100:6:Bacula:/var/bacula:/sbin/nologin

However, switching the bacula shell from /sbin/nologin to /bin/bash (the 
same as user postgresql) did not change the behavior, so I restored it 
to how the RPMs created it. it did allow me to do the "psql bacula" 
wtihout error, but the director still failed with exactly the same message.

In bacula-dir.conf is the declaration
    dbname = bacula; user = bacula; password = ""
I used the PostgreSQL admin section of Webmin to set a password for the 
user and entered it in bacula-dir.conf, but there was no change in behavior.

Any other suggestions?
    

Firstly, note that PostgreSQL user names are not the same as Linux login names
(both have to set up independently).  Confusion arises because the psql
command uses the current Linux login name as the PostgreSQL user name by
default.

Do any of these commands works?

psql -U bacula -d bacula
psql -U bacula -d bacula --password
psql -U postgresql -d bacula
psql -U postgresql -d bacula --password
  
All of those fail like this:
[EMAIL PROTECTED] bacula]# psql -U bacula -d bacula
psql: FATAL:  Ident authentication failed for user "bacula"

I did mess with the password for user bacula last night, the Webmin console reports that "Requires password?" is set to No for user postgres. There is no user postgresql, but the error was still the same.

However, if I "su postgres" and immediately do "psql bacula" it happily drops to the terminal.
One of these should produce the PostgreSQL interactive terminal.

If you get this, what do these commands print?

\dt
\dp
\du
select * from version;
  
bacula=# \dt
           List of relations
 Schema |     Name     | Type  | Owner
--------+--------------+-------+-------
 public | basefiles    | table | root
 public | cdimages     | table | root
 public | client       | table | root
 public | counters     | table | root
 public | device       | table | root
 public | file         | table | root
 public | filename     | table | root
 public | fileset      | table | root
 public | job          | table | root
 public | jobmedia     | table | root
 public | media        | table | root
 public | mediatype    | table | root
 public | path         | table | root
 public | pool         | table | root
 public | status       | table | root
 public | storage      | table | root
 public | unsavedfiles | table | root
 public | version      | table | root
(18 rows)

bacula=# \dp
                         Access privileges for database "bacula"
 Schema |           Name            |   Type   |            Access privileges
--------+---------------------------+----------+-----------------------------------------
 public | basefiles                 | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | basefiles_baseid_seq      | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | cdimages                  | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | client                    | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | client_clientid_seq       | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | counters                  | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | device                    | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | device_deviceid_seq       | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | file                      | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | file_fileid_seq           | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | filename                  | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | filename_filenameid_seq   | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | fileset                   | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | fileset_filesetid_seq     | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | job                       | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | job_jobid_seq             | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | jobmedia                  | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | jobmedia_jobmediaid_seq   | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | media                     | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | media_mediaid_seq         | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | mediatype                 | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | mediatype_mediatypeid_seq | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | path                      | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | path_pathid_seq           | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | pool                      | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | pool_poolid_seq           | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | status                    | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | storage                   | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | storage_storageid_seq     | sequence | {root=arwdRxt/root,bacula=rw/root}
 public | unsavedfiles              | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
 public | version                   | table    | {root=arwdRxt/root,bacula=arwdRxt/root}
(31 rows)

bacula=# \du
                               List of roles
 Role name | Superuser | Create role | Create DB | Connections | Member of
-----------+-----------+-------------+-----------+-------------+-----------
 bacula    | yes       | no          | yes       | no limit    |
 postgres  | yes       | yes         | yes       | no limit    |
 root      | yes       | no          | yes       | no limit    |
(3 rows)

bacula=# select * from version;
 versionid
-----------
         9
         9
(2 rows)


-- 
----------------------------------------------------------
Sign up now for Quotes of the Day, a handful of quotations
on a theme delivered every morning.
Enlightenment! Daily, for free! 
mailto:[EMAIL PROTECTED]

For photography, web design, hosting, and maintenance, 
visit Van's home page: http://www.domainvanhorn.com/van/
-----------------------------------------------------------
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to