Skip site navigation (1) Skip section navigation (2)

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: (view raw or whole thread)
Lists: pgsql-admin
Hash: SHA1


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:

> 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

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

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.

- --
Version: GnuPG v1.2.1 (GNU/Linux)


In response to


pgsql-admin by date

Next:From: IainDate: 2004-10-21 06:44:21
Subject: replication using WAL archives
Previous:From: Jagdish raoDate: 2004-10-21 06:02:42
Subject: Linux not starting postgres automatically

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group