Re: Linux not starting postgres automatically

Поиск
Список
Период
Сортировка
От Devrim GUNDUZ
Тема Re: Linux not starting postgres automatically
Дата
Msg-id Pine.LNX.4.61.0410210905320.28988@emo.org.tr
обсуждение исходный текст
Ответ на Linux not starting postgres automatically  (Jagdish rao <aquajags@yahoo.com>)
Ответы indexes are not working for  (Anshaj <anshaj@in2m.com>)
Список 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-----

В списке pgsql-admin по дате отправления:

Предыдущее
От: Jagdish rao
Дата:
Сообщение: Linux not starting postgres automatically
Следующее
От: "Iain"
Дата:
Сообщение: replication using WAL archives