Modified postgres.sh to allow graceful shutdown of PostgreSQL service