Thread: Startup Script

Startup Script

From
"Duncan Kinder"
Date:
I have been told on the Novice list that in order to start Postgres for an
Internet connection, it needs to have the -i flag set.

However, following the documentation, for RedHat automatic startups, I have
inserted the following language in my /etc/inittab file:

pg:2345:respawn:/bin/su - Postgres -c
"/usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data >>
/usr/local/pgsql/server.log 2>&1 </dev/null"

I would like to know how to edit this language so that Postgres will
automatically start with the -i flag.

This would enable me to work with the very interesing looking kpsql add-on,
which will not work unless I can set this -i flag.

Thanks in advance.



Regards,

Duncan C. Kinder
dckinder@mountain.net





Re: [GENERAL] Startup Script

From
Herouth Maoz
Date:
At 20:13 +0200 on 12/10/1999, Duncan Kinder wrote:


> pg:2345:respawn:/bin/su - Postgres -c
> "/usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data >>
> /usr/local/pgsql/server.log 2>&1 </dev/null"
>
> I would like to know how to edit this language so that Postgres will
> automatically start with the -i flag.
>
> This would enable me to work with the very interesing looking kpsql add-on,
> which will not work unless I can set this -i flag.

Just add "-i" before the "-D" in the postmaster command.

pg:2345:respawn:/bin/su - Postgres -c
"/usr/local/pgsql/bin/postmaster -i -D/usr/local/pgsql/data >>
/usr/local/pgsql/server.log 2>&1 </dev/null"

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



Re: [GENERAL] Startup Script

From
Dan Parker
Date:
On Tue, 12 Oct 1999, Duncan Kinder wrote:

>
> I have been told on the Novice list that in order to start Postgres for an
> Internet connection, it needs to have the -i flag set.
>
> However, following the documentation, for RedHat automatic startups, I have
> inserted the following language in my /etc/inittab file:
>
> pg:2345:respawn:/bin/su - Postgres -c
> "/usr/local/pgsql/bin/postmaster -D/usr/local/pgsql/data >>
> /usr/local/pgsql/server.log 2>&1 </dev/null"
>
> I would like to know how to edit this language so that Postgres will
> automatically start with the -i flag.

Duncan,

Change the line to:

pg:2345:respawn:/bin/su - Postgres -c
"/usr/local/pgsql/bin/postmaster -i -D/usr/local/pgsql/data >>
/usr/local/pgsql/server.log 2>&1 </dev/null"

For what it's worth, this starts the server as part of the system startup
for init levels 2, 3, 4, and 5.  The respawn means that if the process
dies or exits it will be immediately restarted.  (Say, doesn't this solve
someone else's problem with restarting the backend?  Was that on the
GENERAL list?)  The 'su' changes the user to 'Postgres' (the user needed
to start the server -- root won't work) and runs the command indicated
after the '-c'.

Hope this helps!

Dan


Re: [GENERAL] Startup Script

From
Chairudin Sentosa Harjo
Date:
Dear all,

My system is SuSE 6.2, postgresql 6.5.2 and pentium III 500.

I have a problem with postmaster respawning too fast.

I followed the installation guide of postgresql 6.5.2 in file INSTALL.
On section 21, "Run postmaster in the background from your ...",
I followed the last method.


* In RedHat Linux edit file /etc/inittab to add the floowing as a single
line:
pg:2345:respawn:/bin/su - postgres -c "/usr/local/pgsql/bin/postmaster"
-D /usr/local/pgsql/data >> /usr/local/pgsql/server.log 2>&1 <
/dev/null"



I see a lot of this messages on my /var/log/messages:

Oct 9 00:01:16 prosolv init: Id "pg" respawning too fast: disabled for 5
minutes
Oct 9 00:06:18 prosolv init: Id "pg" respawning too fast: disabled for 5
minutes
Oct 9 00:11:20 prosolv init: Id "pg" respawning too fast: disabled for 5
minutes
Oct 9 00:16:22 prosolv init: Id "pg" respawning too fast: disabled for 5
minutes

I have about 1271 messages like this until today, 13 Oct 1999.
It seems to happen every 5 minutes.
What is happening?
Could someone tell me what have I done wrong?

Regards,
Chairudin Sentosa