Re: Linux not starting postgres automatically

From: Devrim GUNDUZ <devrim(at)gunduz(dot)org>
To: Jagdish rao <aquajags(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Linux not starting postgres automatically
Date: 2004-10-21 06:22:04
Message-ID: Pine.LNX.4.61.0410210905320.28988@emo.org.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On Wed, 20 Oct 2004, Jagdish rao wrote:

> i have a Linux redhat 9 machine
> and i have installed the POstgres 7.4.5 using the
> sources

RPMs for Red Hat 9 are also available from any PostgreSQL FTP mirrors; you
could install the RPMs also: www.postgresql.org/mirrors-ftp.html

> the problem heppens when i want the postgres to start
> automatically when my server is booted
> i have written a shell script in rc.local for doing
> this which looks as shown below
> my applications like jonas are stared as User : root
> i login as root which starts my applicatios
> automatically
> but as postgres has to be started only as user :
> postgres
> shell scripts stops at the command su postgres and
> does not execute further.

You should execute something like this:

su -l postgres -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start"

Put this line in /etc/rc.local. (If you've installed PostgreSQL under a
different directory, then edit the line above)

...or download

http://postgresql.gunduz.org/init_scripts/RedHat9/postgresql-source

and move it under /etc/init.d with the name postgresql . Then
run

chkconfig --add postgresql
chkconfig --levels 2345 postgresql on

Modify the script if you've installed postgresql under a different
directory than /usr/local/pgsql

> i searched for help and some suggestions were
>
> using chkconfig --add postgresql
> when i did that it says error reading info on
> postgresql service no such file or directory
> i guess this is bcos postgres is not installed as a
> service

Since you haven't installed from RPMs, there is no default init script
installed under /etc/init.d. So chkconfig does not make sense there. If
you install postgresql from the RPMs, then running

chkconfig --levels 2345 postgresql on

will help you.

Regards,
- --
Devrim GUNDUZ
devrim~gunduz.org devrim.gunduz~linux.org.tr
http://www.tdmsoft.com
http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBd1WOtl86P3SPfQ4RAv+JAKDif1al63T8pfY1s7Rqi6qBcasAsgCdG9lB
wGNSfnmwtWzYkuUnbkmHZ80=
=dPf1
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Iain 2004-10-21 06:44:21 replication using WAL archives
Previous Message Jagdish rao 2004-10-21 06:02:42 Linux not starting postgres automatically