Thread: Trying to auto start Postgres when server boots up

Trying to auto start Postgres when server boots up

From
"Shahid Butt"
Date:
Hi,

I am using PostgreSQL 7.4.7 and Red Hat Enterprise Linux 4.

I want to start the Postgres Postmaster automatically when the server
boots up.
I have tried putting the command
"/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l
/usr/local/pgsql/data/server.log start"
In the /etc/rc.d/rc.local file but when the server boots up it gets
stuck at the point "Enabling swap space   [OK]".
Usually the Red Hat desktop would come up but it doesn't.

Any ideas?


Regards,

Shahid Butt
IT Systems Developer

shahid.butt@nccedu.com


Re: Trying to auto start Postgres when server boots up

From
"Jonel Rienton"
Date:
This might be trivial, but, shouldn't you su to the user(postgres or
whatever you used) that's supposed to run the postmaster?

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Shahid Butt
Sent: Monday, February 06, 2006 9:34 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Trying to auto start Postgres when server boots up

Hi,

I am using PostgreSQL 7.4.7 and Red Hat Enterprise Linux 4.

I want to start the Postgres Postmaster automatically when the server boots
up.
I have tried putting the command
"/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l
/usr/local/pgsql/data/server.log start"
In the /etc/rc.d/rc.local file but when the server boots up it gets
stuck at the point "Enabling swap space   [OK]".
Usually the Red Hat desktop would come up but it doesn't.

Any ideas?


Regards,

Shahid Butt
IT Systems Developer

shahid.butt@nccedu.com


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

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.2/252 - Release Date: 2/6/2006



Re: Trying to auto start Postgres when server boots up

From
Christopher Browne
Date:
> I am using PostgreSQL 7.4.7 and Red Hat Enterprise Linux 4.
>
> I want to start the Postgres Postmaster automatically when the server
> boots up.
> I have tried putting the command
> "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l
> /usr/local/pgsql/data/server.log start"
> In the /etc/rc.d/rc.local file but when the server boots up it gets
> stuck at the point "Enabling swap space   [OK]".
> Usually the Red Hat desktop would come up but it doesn't.
>
> Any ideas?

I'd be inclined to put a startup script in /etc/init.d, which accepts
start and stop arguments, and then put the appropriate links into, oh,
probably /etc/rc3.d to point to the /etc/init.d script.

/etc/rc3.d/S99postgresql would point to /etc/init.d/postgresql; as
would also /etc/rc3.d/K99postgresql.

That's how you're supposed to add services...
--
output = reverse("moc.liamg" "@" "enworbbc")
http://linuxdatabases.info/info/x.html
Giving up  on assembly language was  the apple in our  Garden of Eden:
Languages  whose use squanders  machine cycles  are sinful.   The LISP
machine now permits LISP programmers to abandon bra and fig-leaf.
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982

Re: Trying to auto start Postgres when server boots up

From
rama krishna
Date:
On 2/6/06, Shahid Butt <Shahid.Butt@nccedu.com> wrote:
> Hi,
>
> I am using PostgreSQL 7.4.7 and Red Hat Enterprise Linux 4.
>
> I want to start the Postgres Postmaster automatically when the server
> boots up.
> I have tried putting the command
> "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l
> /usr/local/pgsql/data/server.log start"
> In the /etc/rc.d/rc.local file but when the server boots up it gets
> stuck at the point "Enabling swap space   [OK]".
> Usually the Red Hat desktop would come up but it doesn't.
>
> Any ideas?
>
>
> Regards,
>
> Shahid Butt
> IT Systems Developer
>
> shahid.butt@nccedu.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>


 You use the command 'ntsysv' in the terminal of u'r linux
 This command will display all the services which are to start when
the system boots up.
 You select 'postgresql' with the help of spacebar and then select 'ok'.

Re: Trying to auto start Postgres when server boots up

From
Tom Lane
Date:
"Shahid Butt" <Shahid.Butt@nccedu.com> writes:
> I am using PostgreSQL 7.4.7 and Red Hat Enterprise Linux 4.

> I want to start the Postgres Postmaster automatically when the server
> boots up.

If you're using an RPM distribution then you shouldn't need to muck with
rc.local.  The startup files are there, you just have to enable them.

    sudo /sbin/service postgresql start
    sudo /sbin/chkconfig postgresql on

            regards, tom lane