summaryrefslogtreecommitdiffstats
path: root/extra/postgresql/post-install
diff options
context:
space:
mode:
Diffstat (limited to 'extra/postgresql/post-install')
-rw-r--r--extra/postgresql/post-install12
1 files changed, 12 insertions, 0 deletions
diff --git a/extra/postgresql/post-install b/extra/postgresql/post-install
new file mode 100644
index 000000000..c0a8a5ee0
--- /dev/null
+++ b/extra/postgresql/post-install
@@ -0,0 +1,12 @@
+getent group $newgroup > /dev/null || groupadd -g 41 postgres
+getent passwd $newuser > /dev/null || useradd -c "PostgreSQL Server" \
+-g postgres -d /srv/pgsql/data \
+ -u 41 postgres
+install -v -m700 -d /srv/pgsql/data
+chown -v postgres /srv/pgsql/data
+chmod 700 /srv/pgsql/data
+su - postgres -c '/usr/bin/initdb -D /srv/pgsql/data'
+
+su - postgres -c '/usr/bin/postmaster -D /srv/pgsql/data > \
+ /srv/pgsql/data/logfile 2>&1 &'
+