Thread: Boneheaded Setup?

Boneheaded Setup?

From
"Shawn Pursley"
Date:
I've currently got pgsql up and running but I have a couple of problems and
I'm wondering if someone can help me.

Here's what I'm getting where postgres should run the postmaster and powner
is the common user account:

[postgres@pusher pgsql]$ nohup postmaster > regress.log 2>&1 &
[1] 691
[postgres@pusher pgsql]$ su powner
Password:
[powner@pusher pgsql]$ psql template1
Connection to database 'template1' failed.
connectDB() failed: Is the postmaster running and accepting connections at
'UNIX
 Socket' on port '5432'?

I setup just about everything that the docs said to, staying away from root,
etc.  If I run that postmaster command from the powner user, then I can
access pgsql, but only as that user.

I'm trying to setup pgaccess and it is failing I believe due to this
problem.  It's giving me an error stating:
Is the Postmaster running (with -i) at localhost and accepting connections
on TCP/IP port '5432'?

Here my setup
Linux Mandrake 5.2
pgsql 6.5.1
pgaccess 0.93

TIA


Shawn Pursley(shawn.pursley@service-transport.com)
Network Administrator
Service Transport
800 528 1616 x 240



Re: [GENERAL] Boneheaded Setup?

From
Simon Drabble
Date:
On Tue, 24 Aug 1999, Shawn Pursley wrote:

> I've currently got pgsql up and running but I have a couple of problems and
> I'm wondering if someone can help me.
>
> Here's what I'm getting where postgres should run the postmaster and powner
> is the common user account:
>
> [postgres@pusher pgsql]$ nohup postmaster > regress.log 2>&1 &
> [1] 691
> [postgres@pusher pgsql]$ su powner
> Password:
> [powner@pusher pgsql]$ psql template1
> Connection to database 'template1' failed.
> connectDB() failed: Is the postmaster running and accepting connections at
> 'UNIX
>  Socket' on port '5432'?
>
> I setup just about everything that the docs said to, staying away from root,
> etc.  If I run that postmaster command from the powner user, then I can
> access pgsql, but only as that user.
>
>
> Shawn Pursley(shawn.pursley@service-transport.com)
>


what does the log say? can you do a ps and see the postmaster process running?


Simon.
--
 "This message will expire soon. Please contact your vendor for an update."

   Simon Drabble                      It's like karma for your brain.
   simon@eskimo.com


Re: [GENERAL] Boneheaded Setup?

From
"Shawn Pursley"
Date:
Simon, et al...

From the regress_log

/usr/bin/postmaster does not find the database system.  Expected to find it
in \
the PGDATA directory "/usr/local/pgsql/data", but unable to open file with
path\
name "/usr/local/pgsql/data/base/template1/pg_class".

No data directory -- can't proceed.

[postgres@pusher pgsql]$ cd /usr/local/pgsql/data/
[postgres@pusher data]$ ls -la
total 53

drwxrwsr-x   3 powner   postgres     1024 Aug 12 17:05 ./
drwxrwsr-x   8 postgres postgres     1024 Aug 18 09:10 ../
-rw-------   1 powner   postgres        4 Aug 12 16:12 PG_VERSION
drwx--S---   4 powner   postgres     1024 Aug 17 11:27 base/
-rw-------   1 powner   postgres     8192 Aug 17 11:27 pg_database
-r--------   1 powner   postgres     3407 Aug 12 16:12 pg_geqo.sample
-rw-------   1 powner   postgres        0 Aug 12 16:12 pg_group
-rw--w----   1 powner   postgres     5191 Aug 12 17:05 pg_hba.conf
-rw--w----   1 powner   postgres     5192 Aug 12 16:12 pg_hba.conf~
-rw-------   1 powner   postgres     8192 Aug 18 11:00 pg_log
-rw-rw-rw-   1 powner   postgres       51 Aug 12 16:12 pg_pwd
-rw-------   1 powner   postgres     8192 Aug 12 16:12 pg_shadow
-rw-------   1 powner   postgres     8192 Aug 18 11:00 pg_variable
[postgres@pusher data]$ cd base/
bash: cd: base/: Permission denied
[postgres@pusher data]$ ps
  PID TTY          TIME CMD
  678 pts/0    00:00:00 bash
 1272 pts/0    00:00:00 ps

It appears that part of my problem is the fact that postgres is not the
owner and therefore cannot read what's in the base/.  What next?

TIA,
Shawn
Simon, et al...

From the regress_log

/usr/bin/postmaster does not find the database system.  Expected to find it
in \
the PGDATA directory "/usr/local/pgsql/data", but unable to open file with
path\
name "/usr/local/pgsql/data/base/template1/pg_class".

No data directory -- can't proceed.

[postgres@pusher pgsql]$ cd /usr/local/pgsql/data/
[postgres@pusher data]$ ls -la
total 53

drwxrwsr-x   3 powner   postgres     1024 Aug 12 17:05 ./
drwxrwsr-x   8 postgres postgres     1024 Aug 18 09:10 ../
-rw-------   1 powner   postgres        4 Aug 12 16:12 PG_VERSION
drwx--S---   4 powner   postgres     1024 Aug 17 11:27 base/
-rw-------   1 powner   postgres     8192 Aug 17 11:27 pg_database
-r--------   1 powner   postgres     3407 Aug 12 16:12 pg_geqo.sample
-rw-------   1 powner   postgres        0 Aug 12 16:12 pg_group
-rw--w----   1 powner   postgres     5191 Aug 12 17:05 pg_hba.conf
-rw--w----   1 powner   postgres     5192 Aug 12 16:12 pg_hba.conf~
-rw-------   1 powner   postgres     8192 Aug 18 11:00 pg_log
-rw-rw-rw-   1 powner   postgres       51 Aug 12 16:12 pg_pwd
-rw-------   1 powner   postgres     8192 Aug 12 16:12 pg_shadow
-rw-------   1 powner   postgres     8192 Aug 18 11:00 pg_variable
[postgres@pusher data]$ cd base/
bash: cd: base/: Permission denied
[postgres@pusher data]$ ps
  PID TTY          TIME CMD
  678 pts/0    00:00:00 bash
 1272 pts/0    00:00:00 ps

It appears that part of my problem is the fact that postgres is not the
owner and therefore cannot read what's in the base/.  What next?

TIA,
Shawn

----- Original Message -----
From: Simon Drabble <simon@eskimo.com>
To: Shawn Pursley <shawn.pursley@acorncomputers.com>
Cc: <pgsql-general@postgreSQL.org>; <pgsql-interfaces@postgreSQL.org>
Sent: Tuesday, August 24, 1999 11:12 AM
Subject: Re: [GENERAL] Boneheaded Setup?


> On Tue, 24 Aug 1999, Shawn Pursley wrote:
>
> > I've currently got pgsql up and running but I have a couple of problems
and
> > I'm wondering if someone can help me.
> >
> > Here's what I'm getting where postgres should run the postmaster and
powner
> > is the common user account:
> >
> > [postgres@pusher pgsql]$ nohup postmaster > regress.log 2>&1 &
> > [1] 691
> > [postgres@pusher pgsql]$ su powner
> > Password:
> > [powner@pusher pgsql]$ psql template1
> > Connection to database 'template1' failed.
> > connectDB() failed: Is the postmaster running and accepting connections
at
> > 'UNIX
> >  Socket' on port '5432'?
> >
> > I setup just about everything that the docs said to, staying away from
root,
> > etc.  If I run that postmaster command from the powner user, then I can
> > access pgsql, but only as that user.
> >
> >
> > Shawn Pursley(shawn.pursley@service-transport.com)
> >
>
>
> what does the log say? can you do a ps and see the postmaster process
running?
>
>
> Simon.
> --
>  "This message will expire soon. Please contact your vendor for an
update."
>
>    Simon Drabble                      It's like karma for your brain.
>    simon@eskimo.com
>
>


Re: [GENERAL] Boneheaded Setup?

From
Simon Drabble
Date:
On Tue, 24 Aug 1999, Shawn Pursley wrote:

> Simon, et al...
>
> >From the regress_log
>
> /usr/bin/postmaster does not find the database system.  Expected to find it
> in \
> the PGDATA directory "/usr/local/pgsql/data", but unable to open file with
> path\
> name "/usr/local/pgsql/data/base/template1/pg_class".
>
> No data directory -- can't proceed.
>
>
> It appears that part of my problem is the fact that postgres is not the
> owner and therefore cannot read what's in the base/.  What next?
>
> TIA,
> Shawn

As root, recursively chown the files in $PGDATA to postgres - this will allow
you to start the postmaster process. You will also need to (as postgres) run
createuser <powner> (if you haven't already) to allow powner to access the db
system.

# chown -r postgres /usr/local/pgsql/

$ su - postgres
$ createuser
Enter name of user to add --->

etc.


Simon.



--
 "This message will expire soon. Please contact your vendor for an update."

   Simon Drabble                      It's like karma for your brain.
   simon@eskimo.com


Re: [GENERAL] Boneheaded Setup?

From
"Shawn Pursley"
Date:
Simon --

Thanks for all the help so far...please don't kill me...

For anyone else doing this exercise...I had to use the -R instead of -r on
Mandrake.

[root@pusher bin]# chown -R postgres /usr/local/pgsql/
[postgres@pusher pgsql]$ nohup postmaster > regress.log 2>&1 &
[1] 1443
[postgres@pusher pgsql]$ createuser
Connection to database 'template1' failed.
FATAL 1:  SetUserId: user 'postgres' is not in 'pg_shadow'

createuser: database access failed.
[postgres@pusher pgsql]$ cd /usr/local/pgsql/data
[postgres@pusher data]$ ls -la
total 62
-rw-------   1 postgres postgres     8195 Aug 24 12:09 #pg_shadow#
drwxrwsr-x   3 postgres postgres     1024 Aug 24 12:09 ./
drwxrwsr-x   8 postgres postgres     1024 Aug 18 09:10 ../
-rw-------   1 postgres postgres        4 Aug 12 16:12 PG_VERSION
drwx--S---   4 postgres postgres     1024 Aug 17 11:27 base/
-rw-------   1 postgres postgres     8192 Aug 17 11:27 pg_database
-r--------   1 postgres postgres     3407 Aug 12 16:12 pg_geqo.sample
-rw-------   1 postgres postgres        0 Aug 12 16:12 pg_group
-rw--w----   1 postgres postgres     5191 Aug 12 17:05 pg_hba.conf
-rw--w----   1 postgres postgres     5192 Aug 12 16:12 pg_hba.conf~
-rw-------   1 postgres postgres     8192 Aug 18 11:00 pg_log
-rw-rw-rw-   1 postgres postgres       51 Aug 12 16:12 pg_pwd
-rw-------   1 postgres postgres     8192 Aug 12 16:12 pg_shadow
-rw-------   1 postgres postgres     8192 Aug 18 11:00 pg_variable

Do you spot anything else wrong?  I tried to emacs pg_shadow, but that is
one ugly files that looks compiled.  I did see that powner resides in there.



Shawn