Re: pg_ctl

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: pg_ctl
Date: 1999-11-27 02:08:51
Message-ID: 19991127110851H.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg_ctl
Date: Fri, 26 Nov 1999 10:38:06 -0500

> Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
> > Here is the first draft for the spec of postmaster starting/stopping
> > tool. I have named it as "pg_ctl."
> > o pg_ctl [-w] start
> > start up postmaster.
>
> How will pg_ctl know what to start --- where do the database directory,
> port number, and path (to locate the postmaster executable) come from?

Very good question. What I'm thinking now is:

the database directory:
1) $PGDATA (as an environmnet variable)
2) hard coded in the pg_ctl script

the path to postmaster:
1) in the command search path
2) hard coded in the pg_ctl script
3) assume that postmaster lives in the same directory where pg_ctl
has been put

> > It would be nice if it could report,
> > for example, the number of backends running (and their pids) etc. For
> > this purpose I propose followings:
>
> > (1) Add another protocol STATUS_REQUEST_CODE to libpq/pqcomm.h.
>
> > (2) Add code to process the protocol in
> > postmaster/postmaster.c:readStartupPacket().
>
> Security issues may be a factor here. Do you want just anyone anywhere
> on the net to be able to extract the postmaster status? If not, how
> shall we restrict it?

I think a resonable restriction would be let anyone on the same
machine that postmaster is running could issue the protocol.

Another idea might be using our host based authentication. What about
having a "virtual database" used only for the status request protocol?
For example, with below setting, any authenticated user on the net
192.168.0.0 could send the protocol. "statusdb" indicates that backend
should treat it in the special way.

host statusdb 192.168.0.0 255.255.255.0 crypt
--
Tatsuo Ishii

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 1999-11-27 02:31:30 Re: [HACKERS] Re: pg_ctl
Previous Message Tatsuo Ishii 1999-11-27 02:05:31 Re: