Bryan:
I missed to use pg_ctl. Hweh! (I was not doing my assignment)
Anyway, thanks.
Ramil:
Thanks. But look how i solved it. Kind of a newbie solution, here's the line:
PGSQL_PID=`cat /usr/share/postgresql/postmaster.pid | grep -e [0123456789] -m 1`
BTW, if you want a newbie rc-like script for pgsql on cygwin, here's what i got:
...
#!/bin/bash
## whats this: PostgreSQL rc-like script on CygWin
## created by: Howard R. Bagcat <[EMAIL PROTECTED]>
## created in: mucns
## created on: sep.19.2003
RES_COL=60
MOVE_TO_COL="echo -en \\033[${RES_COL}G"
SETCOLOR_SUCCESS="echo -en \\033[1;32m"
SETCOLOR_FAILURE="echo -en \\033[1;31m"
SETCOLOR_WARNING="echo -en \\033[1;33m"
SETCOLOR_NORMAL="echo -en \\033[0;39m"
BOOTUP=color
echo_success() {
[ "$BOOTUP" = "color" ] && $MOVE_TO_COL
echo -n "[ "
[ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS
echo -n $"OK"
[ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
echo -n " ]"
echo -ne "\r"
return 0
}
echo_failure() {
[ "$BOOTUP" = "color" ] && $MOVE_TO_COL
echo -n "["
[ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE
echo -n $"FAILED"
[ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
echo -n "]"
echo -ne "\r"
return 1
}
case "$1" in
start)
#start
## initialize cygwin-win98 ipc
#echo -n $"Starting ipc-daemon:"
/usr/bin/ipc-daemon.exe &
## settings for pgsql
export PGDATA=/usr/share/postgresql/data
## call pgsql server
echo -n $"Starting PostgreSQL:"
/usr/bin/postmaster -i >> /var/log/pgsql 2>&1 < /dev/null &
PGSQL_PID=`cat /usr/share/postgresql/data/postmaster.pid | grep -e
[0123456789] -m 1`
if [ PGSQL_PID ]; then
echo_success
else
echo_failure
fi
echo
;;
stop)
#stop
echo -n $"Stopping PostgreSQL:"
PGSQL_PID=`cat /usr/share/postgresql/data/postmaster.pid | grep -e
[0123456789] -m 1`
kill -TERM $PGSQL_PID >> /var/log/pgsql
ret=$?
if [ $ret -eq 0 ]; then
echo_success
else
echo_failure
fi
echo
;;
*)
echo $"Usage: $0 {start|stop}"
RETVAL=1
esac
exit $RETVAL
...
Howard.
Sulat @MU v.2.2 (Fresh)
.......................................................................................
An extended module for MUWeb4 Project of Howard R. Bagcat
Powered by GNU General Public License softwares.
http://my.mu.edu.ph - a personalized portal is soon to come.
--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie