Blob


1 #!/bin/sh
3 service_postgresql() {
4 postgres -V | grep -q PostgreSQL && {
5 test -d /var/postgresql/data || {
6 # TODO: Not ready
7 su - postgresql -c '
8 mkdir /var/postgresql/data
9 initdb -D /var/postgresql/data -U postgres -A scram-sha-256 -E UTF8 -W
10 '
11 rcctl enable postgresql
12 rcctl start postgresql
13 }
14 node postgresql/data/pg_hba.conf &&
15 nodeinstall -m 600 -o _postgresql:_postgresql \
16 postgresql/data/pg_hba.conf /var/postgresql/data/ &&
17 rcctl restart postgresql
18 node postgresql/data/postgresql.conf &&
19 nodeinstall -m 600 -o _postgresql:_postgresql \
20 postgresql/data/postresql.conf /var/postgresql/data/ &&
21 rcctl restart postgresql
22 }
23 }