From 0dcce2ac18a27a8348cbf6c021db1877f701a5cf Mon Sep 17 00:00:00 2001 From: tomit4 Date: Wed, 27 Apr 2022 12:42:52 -0700 Subject: [PATCH] had to manually fix postgresql script --- runit_scripts/postgresql/run | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/runit_scripts/postgresql/run b/runit_scripts/postgresql/run index b9809968..ca1d5273 100755 --- a/runit_scripts/postgresql/run +++ b/runit_scripts/postgresql/run @@ -8,13 +8,19 @@ if [ "$PGROOT" != "/var/lib/postgres" ]; then ln -sf "$PGROOT" /var/lib/postgres fi +if [ ! -d "/var/run/postgresql" ]; then + echo "creating directory /var/run/postgresql" + + mkdir -p "/var/run/postgresql" + chown -R postgres:postgres "/var/run/postgresql" +fi if [ ! -d "$PGDATA" ]; then echo "Initializing database in $PGDATA" - mkdir -p "$PGDATA" + mkdir -p "$PGDATA" chown -R postgres:postgres "$PGDATA" - chmod 777 "$PGDATA" + chmod 0700 "$PGDATA" su - postgres -m -c "/usr/bin/initdb $INITOPTS -D '$PGDATA'" >/dev/null if [ -f /etc/postgresql/postgresql.conf ]; then