dbTalk Databases Forums  

[BUGS] pg_ctl -w start does not know that it has started postmaster

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] pg_ctl -w start does not know that it has started postmaster in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Aaron Hillegass
 
Posts: n/a

Default [BUGS] pg_ctl -w start does not know that it has started postmaster - 11-22-2004 , 02:14 PM






Your name : Aaron Hillegass
Your email address : aaron (AT) bignerdranch (DOT) com


System Configuration
---------------------
Architecture (example: Intel Pentium) : PPC

Operating System (example: Linux 2.4.18) : Mac OS X 10.3.5

PostgreSQL version (example: PostgreSQL-8.0): PostgreSQL-8.0b4

Compiler used (example: gcc 2.95.2) : gcc version 3.3 20030304
(Apple Computer, Inc. build 1666)


Please enter a FULL description of your problem:
------------------------------------------------

I have a script that must start the postmaster before continuing, so I
do this:

Quote:
sudo -u postgres /Library/PostgreSQL/bin/pg_ctl -w start
But this always fails:

Quote:
sudo -u postgres /Library/PostgreSQL/bin/pg_ctl -w start
waiting for postmaster to
start............................................. ..................coul
d not start postmaster

But the postmaster is actually started:

Quote:
/Library/PostgreSQL/bin/psql -Unopali template1
Welcome to psql 8.0.0beta4, the PostgreSQL interactive terminal.

template1=#

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

Note that the process's user name (postgres) is different from the
database's owner (nopali).


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

I suspect that the problem is that when I did initdb, I used 'nopali'
as the username, but pg_ctl is being run as 'postgres'. Because there
is no database user called 'postgres', I think that this line in
pg_ctl.c always fails:

if ((conn = PQsetdbLogin(NULL, portstr, NULL, NULL,

"template1", NULL, NULL)) != NULL &&
(PQstatus(conn) == CONNECTION_OK ||
(strcmp(PQerrorMessage(conn),
PQnoPasswordSupplied) == 0)))



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] pg_ctl -w start does not know that it has started postmaster - 11-22-2004 , 03:20 PM






Aaron Hillegass <aaron (AT) bignerdranch (DOT) com> writes:
Quote:
I have a script that must start the postmaster before continuing, so I
do this:

sudo -u postgres /Library/PostgreSQL/bin/pg_ctl -w start
This is not going to work very well because sudo doesn't update the
environment --- for example if PGUSER is set in your environment then
that's the username pg_ctl will try to use to connect with. Perhaps
try

sudo su -l postgres -c '/Library/PostgreSQL/bin/pg_ctl -w start'

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.