Initial commit

This commit is contained in:
2025-09-30 20:55:34 +03:00
commit 905d2346b7
8 changed files with 150 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
PGROOT=/srv/postgresql
PGDATA="$PGROOT"/data
[ -d /run/postgresql ] || install -d -o postgres -g postgres /run/postgresql
[ "$PGROOT" != "/srv/postgresql" ] && ln -sf "$PGROOT" /srv/postgresql
if [ ! -d "$PGDATA" ]; then
install -dm0700 -o postgres -g postgres "$PGDATA"
su - postgres -m -c "/usr/bin/initdb -D '$PGDATA'"
[ -f /etc/postgresql/postgresql.conf ] && ln -sf /etc/postgresql/postgresql.conf "$PGDATA"/postgresql.conf
fi
exec su - postgres -m -c "/usr/bin/postgres -D '$PGDATA'"