Easy Postgresql master/slave replication with automatic failover on Linux?
Have a look at repmgr. It's a free software product that is meant to manage failovers and switchovers with PostgreSQL built-in replication.