Hello!

The problem is that I want to write a script "pg_start" that would do the following:

1) start cygserver daemon (cygserver -e -Y >>logfile 2>&1)
2) make sure that the initialization of the daemon is fully completed!!!
3) start the postmaster (pg_ctl -l ... start)

I really don't know how to program step 2 above. I wrote the following code:

while :; do
 if [ `ps | grep -c 'CYGSERVER'` -eq 1 ]; then
   break
 fi
done

but it did not work :( I think that it was because the line containing 'CYGSERVER' appeared in the `ps` output BEFORE the daemon finished its initialization. Am I right?

Can anybody suggest a proper solution?

Thank you.

----
Alexey Lyubimov


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to