Initial commit
This commit is contained in:
@@ -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'"
|
||||
Reference in New Issue
Block a user