Thread: Starting postmaster with the option -i

Starting postmaster with the option -i

From
raquel.vieira@ent.efacec.pt (Raquel Vieira)
Date:
I'm using Postgres 7.1.2 and I need to use TCP/IP connections, so I
want to start Postmaster with the option -i.
The Postmaster is starting allone at the startup of the computer, but
it initiates by itself, I can't start it with that option. I have to
stop it and start it again with the option by myself.
Does anyone know how can I start postmaster (at the startup of the
computer) with the option -i?

Thank you,

Raquel

Re: Starting postmaster with the option -i

From
Gary Stainburn
Date:
Hi Raquel,

The postmaster is probably being started using pg_ctl in
/etc/init.d/postgresql.

Add -o -i to the line, which tells pg_ctl to send the '-i' switch to the
back-end.

Gary

On Friday 31 August 2001  9:38 am, Raquel Vieira wrote:
> I'm using Postgres 7.1.2 and I need to use TCP/IP connections, so I
> want to start Postmaster with the option -i.
> The Postmaster is starting allone at the startup of the computer, but
> it initiates by itself, I can't start it with that option. I have to
> stop it and start it again with the option by myself.
> Does anyone know how can I start postmaster (at the startup of the
> computer) with the option -i?
>
> Thank you,
>
> Raquel
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl

--
Gary Stainburn

This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000

Re: Starting postmaster with the option -i

From
speedboy
Date:
[root@b] : cat /etc/rc.d/init.d/postgresql
#!/bin/sh
#[ -x /tmp/.s.PGSQL.* ] && rm -f /tmp/.s.PGSQL.*
case "$1" in
  'start')
  su - postgres -c 'exec /usr/local/pgsql/bin/pg_ctl -o -i -D
/home/postgres/data start >> /usr/local/pgsql/errlog 2>&1 &'
  ;;

  'stop')
  su - postgres -c 'exec /usr/local/pgsql/bin/pg_ctl -D
/home/postgres/data stop >> /usr/local/pgsql/errlog 2>&1 &'
  ;;

  *)
        echo "usage: $0 start|stop"
        exit 1
  ;;
esac
[root@b]:

That help? :)


Re: Starting postmaster with the option -i

From
Lamar Owen
Date:
On Friday 31 August 2001 04:38, Raquel Vieira wrote:
> Does anyone know how can I start postmaster (at the startup of the
> computer) with the option -i?

If this is an RPM installation (which is what it sounds like), edit the file
/var/lib/pgsql/data/postgresql.conf and set the 'tcpip_socket' config to
'true' and uncomment it. This is the exact same thing as passing -i to
postmaster.

Editing the initscript is not recommended.

And please read
http://www.postgresql.org/ftpsite/binary/v7.1.3/RPMS/README.rpm-dist

While it is for 7.1.3, it contains your answer for 7.1.2.

Hope that helps...
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Re: Starting postmaster with the option -i

From
"Nick Fankhauser"
Date:
Raquel-

I believe that by v7.1, this could be placed in the postgresql.conf file.
(Found in /etc/postgresql on our Debian Linux box.) the line to add is:

tcpip_socket = 1

check out this page for details:

http://www.postgresql.org/idocs/index.php?runtime-config.html


It's probably not starting up right because of something going on in
/etc/init.d/postgresql on the startup. Try looking in this file if you want
to do the startup using the -i command line option.

-Nick




> I'm using Postgres 7.1.2 and I need to use TCP/IP connections, so I
> want to start Postmaster with the option -i.
> The Postmaster is starting allone at the startup of the computer, but
> it initiates by itself, I can't start it with that option. I have to
> stop it and start it again with the option by myself.
> Does anyone know how can I start postmaster (at the startup of the
> computer) with the option -i?


Re: Starting postmaster with the option -i

From
Stephan Szabo
Date:
On 31 Aug 2001, Raquel Vieira wrote:

> I'm using Postgres 7.1.2 and I need to use TCP/IP connections, so I
> want to start Postmaster with the option -i.
> The Postmaster is starting allone at the startup of the computer, but
> it initiates by itself, I can't start it with that option. I have to
> stop it and start it again with the option by myself.
> Does anyone know how can I start postmaster (at the startup of the
> computer) with the option -i?

IIRC, the easiest way under 7.1 is to edit the postgresql.conf file
and set tcpip_socket = true.


Re: Starting postmaster with the option -i

From
Shaun Thomas
Date:
On 31 Aug 2001, Raquel Vieira wrote:

> Does anyone know how can I start postmaster (at the startup of the
> computer) with the option -i?

The file that is starting postgres is one of these:

/etc/rc.d/init.d/postgresql
/etc/rc.d/init.d/postgres
/etc/rc.d/init.d/postgresd

The last one is the most likely candidate.  All you need to do is
edit this file and add the -i option to the spot where it actually
starts postgres.

At least, if you're comfortable editing bash scripts.

--
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Shaun M. Thomas                INN Database Programmer              |
| Phone: (309) 743-0812          Fax  : (309) 743-0830                |
| Email: sthomas@townnews.com    AIM  : trifthen                      |
| Web  : hamster.lee.net                                              |
|                                                                     |
|     "Most of our lives are about proving something, either to       |
|      ourselves or to someone else."                                 |
|                                           -- Anonymous              |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+



Re: Starting postmaster with the option -i

From
Lamar Owen
Date:
On Friday 31 August 2001 09:50, Gary Stainburn wrote:
> The postmaster is probably being started using pg_ctl in
> /etc/init.d/postgresql.

> Add -o -i to the line, which tells pg_ctl to send the '-i' switch to the
> back-end.

PLEASE don't edit /etc/rc.d/init.d/postgresql.  Edit
/var/llib/pgsql/data/postgresql.conf instead.  The initscript WILL get
overwritten on the next RPM upgrade.

This is becoming a FAQ.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Re: Starting postmaster with the option -i

From
Lamar Owen
Date:
On Friday 31 August 2001 09:55, speedboy wrote:
> [root@b] : cat /etc/rc.d/init.d/postgresql
>   su - postgres -c 'exec /usr/local/pgsql/bin/pg_ctl -o -i -D
> That help? :)

While this _does_ work, why not use postgresql.conf for its proper purpose?
The RPM initscript, for security reasons, does not by default enable -i
anymore.  It did at one point, which, in hindsight, was an error on my part.

Eventually the RPM initscript will support multiple postmasters.  Some of
those may need tcpip_sockets and some may not.  Each postmaster will have its
own PGDATA and its own postgresql.conf, but there will only be one initscript
with an iterative loop.  Use the GUC file -- it's there and it works.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Re: Starting postmaster with the option -i

From
Gary Stainburn
Date:
Thanks for the information, I've now put back /etc/rc.d/init.d/postgresql and
updated postgresql.conf.

Gary

On Friday 31 August 2001 7:59 pm, Lamar Owen wrote:
> On Friday 31 August 2001 09:50, Gary Stainburn wrote:
> > The postmaster is probably being started using pg_ctl in
> > /etc/init.d/postgresql.
> >
> > Add -o -i to the line, which tells pg_ctl to send the '-i' switch to the
> > back-end.
>
> PLEASE don't edit /etc/rc.d/init.d/postgresql.  Edit
> /var/llib/pgsql/data/postgresql.conf instead.  The initscript WILL get
> overwritten on the next RPM upgrade.
>
> This is becoming a FAQ.

--
Gary Stainburn

This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000