Trying to auto start Postgres when server boots up

Started by Shahid Buttabout 20 years ago5 messagesgeneral
Jump to latest
#1Shahid Butt
Shahid.Butt@nccedu.com

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

#2Jonel Rienton
jonel@rientongroup.com
In reply to: Shahid Butt (#1)
Re: Trying to auto start Postgres when server boots up

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

#3Chris Browne
cbbrowne@acm.org
In reply to: Shahid Butt (#1)
Re: Trying to auto start Postgres when server boots up

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

#4rama krishna
arkr505@gmail.com
In reply to: Shahid Butt (#1)
Re: Trying to auto start Postgres when server boots up

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'.

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Shahid Butt (#1)
Re: Trying to auto start Postgres when server boots up

"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