/etc/init.d/mypostgres
#!/bin/sh
#
# PostgreSQL start and shutdown script
#
# chkconfig: 345 90 11
# description: PostgreSQL start and shutdown script
PGPATH=/usr/local/pgsql
. /etc/init.d/functions
case "$1" in
start)
su - postgres -c "${PGPATH}/bin/pg_ctl -o "-S -i" start"
touch /var/lock/subsys/postgres
;;
stop)
su - postgres -c "${PGPATH}/bin/pg_ctl -m f stop"
rm -f /var/lock/subsys/postgres
;;
*)
echo "Usage: /etc/rc.d/init.d/postgres {start|stop}"
esac
exit 0chmod +x /etc/init.d/mypostgres


