#!/bin/sh -e

# Create and start a standard 8.0 cluster which should land on port 5433.
# After starting it, we check that the postmaster actually runs and the correct
# socket directory. Since we have contrib installed, there should also be an
# autovacuum daemon.

pg_createcluster 8.0 pg80 --start
pg_lsclusters
ps -o user,group,args -C postmaster | grep postmaster | uniq
ps -o user,group,args -C pg_autovacuum
echo "Socket directory:"
ls -a /var/run/postgresql/
su -s /bin/sh -c 'psql --version --cluster 8.0/pg80' postgres
su -s /bin/sh -c 'psql -l --cluster 8.0/pg80' postgres
