POSTGRESQL -->PQexec() -- There is no connection to the backend

Bruno Unna bruno@iac.com.mx
Mon, 15 Jun 1998 10:46:15 -0500


This is a multi-part message in MIME format.
--------------D4ADFD60EE8A9F2F6468F7A6
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

JESUS AVILA MOLINA wrote:
> 
> 
> Configuracion del fichero ".bash_profile"!!!
> --------------------------------------------
> PATH=$PATH:$HOME/bin
> ENV=$HOME/.bashrc
> USERNAME="postgres"
> 
> export USERNAME ENV PATH
> 
> PATH=$PATH:/usr/local/pgsql/bin
> MANPATH=$MANPATH:/usr/local/pgsql/man
> PGLIB=/usr/local/pgsql/lib
> PGDATA=/usr/local/pgsql/data
> export PATH MANPATH PGLIB PGDATA
> 
> nohup postmaster -d > server.log 2>&1 &

Esta forma de levantar el demonio está de los más 
original. Te recomiendo que lo levantes mejor usando 
el mecanismo tradicional de system V.

Mira, para empezar, es útil que el demonio esté 
corriendo como perteneciente al usuario 'nobody', 
igual que el otro demonio importante en este 
circo: 'apache'. Para tal efecto, la línea que 
has de correr es más o menos así:

su postgres -c "/usr/local/pgsql/bin/postmaster -i -B 256 '-o -S 2048'
-S -D/usr/local/pgsql/data >>/opt/home/postgres/postmaster.log 2>&1 &"

Nota que para poder hacer eso tienes que ser un 
usuario de gran autoridad (root, pues). Esa línea 
debería estar contenida en un archivo dentro del 
directorio /etc/rc.d/init.d/, y debe haber ligas 
desde el directorio /etc/rc.d/rc<nivel>.d, llamadas 
S<numero>postgres, al archivo que menciono (y que 
anexo), donde 'nivel' es el 'runlevel' en que 
arrancas la máquina (normalmente 3 ó 5) y 
'numero', entre 00 y 99, indica el orden en que 
debe levantar este demonio con respecto a los 
otros existentes ahí. Te recomiendo algo como 65.

Suerte, saludos.
-- 
"Create like a god,                Bruno Unna <bruno@iac.com.mx>
 command like a king,                     Desarrollo de Software
 and work like a slave."                Internet de Alta Calidad
             Kawasaki                   PGP public key available
--------------D4ADFD60EE8A9F2F6468F7A6
Content-Type: text/plain; charset=us-ascii; name="postgres.init"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="postgres.init"

#!/bin/sh
#
# Postgres      Setup the postmaster daemon.
#

# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
  start)
	echo -n "Starting Postgresql Deamon: "

	[ "`pidofproc postmaster`" != "" ] && exit    	
	su postgres -c "/usr/local/pgsql/bin/postmaster -i -B 256 '-o -S 2048' -S -D/usr/local/pgsql/data >>/opt/home/postgres/postmaster.log 2>&1 &"
	echo postmaster
	touch /var/lock/subsys/postmaster
	;;
  stop)
	echo -n "Stopping Postgresql Deamon: "
	killproc postmaster
	echo
	rm -f /var/lock/subsys/postmaster
	;;
  *)
	echo "Usage: postgres.init {start|stop}"
	exit 1
esac

exit 0

--------------D4ADFD60EE8A9F2F6468F7A6--