Look at inotify: https://github.com/rvoicilas/inotify-toolsYou can check for instance if postmaster.pid exists.
--Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html