# DOC: http://wiki.postgresql.org/wiki/Shared_Database_Hosting
-"$tool"/local/apt-get-install postgresql-9.1
+"$tool"/local/apt-get-install postgresql-9.4
"$tool"/local/insserv-remove postgresql
"$tool"/local/adduser postgres \
--disabled-login \
/home/postgresql \
/home/postgresql/etc \
/etc/postgresql \
- /etc/postgresql/9.1 \
- /etc/postgresql/9.1/main
+ /etc/postgresql/9.4 \
+ /etc/postgresql/9.4/main
sudo ln -fns \
/etc/postgresql \
/home/postgresql/etc/postgresql
/home/postgresql/data
sudo -u postgres pg_createcluster \
--datadir=/home/postgresql/data \
- --logfile=/home/postgresql/log/9.1/main/cluster.log \
+ --logfile=/home/postgresql/log/9.4/main/cluster.log \
--socketdir=/run/postgresql \
- 9.1 main
+ 9.4 main
fi
sudo install -m 640 -o postgres -g postgres /dev/stdin \
- /etc/postgresql/9.1/main/pg_ctl.conf <<-EOF
+ /etc/postgresql/9.4/main/pg_ctl.conf <<-EOF
pg_ctl_options = ''
EOF
sudo install -m 640 -o postgres -g postgres /dev/stdin \
- /etc/postgresql/9.1/main/pg_ident.conf <<-EOF
- # MAPNAME SYSTEM-USERNAME PG-USERNAME
- admin postgres postgres
- admin root postgres
- EOF
-sudo install -m 640 -o postgres -g postgres /dev/stdin \
- /etc/postgresql/9.1/main/start.conf <<-EOF
- EOF
-sudo install -m 640 -o postgres -g postgres /dev/stdin \
- /etc/postgresql/9.1/main/pg_hba.conf <<-EOF
- local all postgres peer map=admin
- local all all peer
- hostssl all postgres samehost cert
+ /etc/postgresql/9.4/main/start.conf <<-EOF
EOF
+sudo install -m 640 -o postgres -g postgres \
+ "$tool"/etc/postgresql/9.4/main/pg_ident.conf \
+ /etc/postgresql/9.4/main/pg_ident.conf
+sudo install -m 640 -o postgres -g postgres \
+ "$tool"/etc/postgresql/9.4/main/pg_hba.conf \
+ /etc/postgresql/9.4/main/pg_hba.conf
sudo install -m 640 -o postgres -g postgres-data \
- "$tool"/etc/postgresql/9.1/main/postgresql.conf \
- /etc/postgresql/9.1/main/postgresql.conf
+ "$tool"/etc/postgresql/9.4/main/postgresql.conf \
+ /etc/postgresql/9.4/main/postgresql.conf
sudo install -m 640 -o postgres -g postgres \
"$tool"/var/pub/x509/postgresql."$local_domainname"/crt+ca.pem \
- /etc/postgresql/9.1/main/server.crt
+ /etc/postgresql/9.4/main/server.crt
sudo install -m 640 -o postgres -g postgres \
"$tool"/var/pub/x509/postgresql."$local_domainname"/crt.self-signed.pem \
- /etc/postgresql/9.1/main/root.crt
+ /etc/postgresql/9.4/main/root.crt
sudo install -m 640 -o postgres -g postgres \
"$tool"/var/pub/x509/postgresql."$local_domainname"/crl.self-signed.pem \
- /etc/postgresql/9.1/main/root.crl
+ /etc/postgresql/9.4/main/root.crl
for f in server.crt server.key root.crt root.crl
do sudo ln -fns \
- /etc/postgresql/9.1/main/$f \
+ /etc/postgresql/9.4/main/$f \
/home/postgresql/data/$f
done