pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Linux not starting postgres automatically
2+ messages / 2 participants
[nested] [flat]

* Linux not starting postgres automatically
@ 2004-10-21 06:02  Jagdish rao <aquajags@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Jagdish rao @ 2004-10-21 06:02 UTC (permalink / raw)
  To: pgsql-admin

hi friends

pls help me 

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

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.

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 

so this didn't help

pls help me in achieving this .

#!bin/tcsh

ANT_HOME=/home/deploy/local/ant

JAVA_HOME=/home/deploy/local/jdk

JONAS_ROOT=/usr/local/JONAS414

PGDATA=/usr/local/pgsql/data

PATH=$JAVA_HOME/bin:/home/deploy/local/ant/bin:/usr/local/pgsql/bin:$PATH:/usr/local/JONAS414/bin/unix

CLASSPATH=:.:$JAVA_HOME/lib:/usr/local/kesintlclasses:/usr/local/JONAS414/lib/commons/j2ee/ejb-2_1-api.jar:/usr/local/JONAS414/lib/commons/j2ee/jta-spec1_0_1.jar

#export JONAS_ROOT PATH JAVA_HOME TOMCAT_HOME

export CLASSPATH PATH JAVA_HOME CATALINA_HOME
JONAS_ROOT PGDATA

echo 'set java home .........'
echo $JAVA_HOME
echo 'starting postgres.....'

(su postgres ; postmaster)

echo 'started postgres.....'


echo 'starting jonas.....'

jonas start









__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Linux not starting postgres automatically
@ 2004-10-21 06:22  Devrim GUNDUZ <devrim@gunduz.org>
  parent: Jagdish rao <aquajags@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Devrim GUNDUZ @ 2004-10-21 06:22 UTC (permalink / raw)
  To: Jagdish rao <aquajags@yahoo.com>; +Cc: 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-----



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-10-21 06:22 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-21 06:02 Linux not starting postgres automatically Jagdish rao <aquajags@yahoo.com>
2004-10-21 06:22 ` Devrim GUNDUZ <devrim@gunduz.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox