problems with startup script on upgrade

Martin A. Marques <martin@math.unl.edu.ar>

From: "Martin A. Marques" <martin@math.unl.edu.ar>
To: pgsql-hackers@postgresql.org
Date: 2001-03-16T19:47:54Z
Lists: pgsql-hackers
I just compiled and installed postgresql from the cvs (upgraded from 7.1beta5 
becuase of some problems I had), followed the steps, and the database server 
works great, but my startup scripts don't work anymore.
What the script has, works if I try to do it as postgres, but with a 
su -l postgres -c 'command' as root it doesn't work.
This is the script (on Solaris 7):

#!/bin/bash
# postgresql	This is the init script for starting up the PostgreSQL
#		server
#
# chkconfig: 345 85 15
# description: Starts and stops the PostgreSQL backend daemon that handles \
#	       all database requests.
# processname: postmaster
#

# This script is slightly unusual in that the name of the daemon (postmaster)
# is not the same as the name of the subsystem (postgresql)

# See how we were called.
case "$1" in
  start)
	echo -n "Starting postgresql service: "
	su -l postgres -c '/dbs/postgres/bin/pg_ctl -o "-i" -D /dbs/postgres/data/ 
start -l /dbs/postgres/sql.log'
	;;
  stop)
	echo -n "Stopping postgresql service: "
	su -l postgres -c '/dbs/postgres/bin/pg_ctl -m i -D /dbs/postgres/data stop'
	echo
	;;
  status)
	su -l postgres -c '/dbs/postgres/bin/pg_ctl -D /dbs/postgres/data/ status'
	;;
  restart)
	$0 stop
	sleep 10
	$0 start
	;;
  *)
	echo "Usage: postgresql {start|stop|status|restart}"
	exit 1
esac

exit 0

-- 
System Administration: It's a dirty job, 
but someone told me I had to do it.
-----------------------------------------------------------------
Martín Marqués			email: 	martin@math.unl.edu.ar
Santa Fe - Argentina		http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------