postgresql: update to 8.4.10, systemd switch.
This commit is contained in:
parent
782694cd41
commit
f151ae9f47
13 changed files with 101 additions and 173 deletions
33
srcpkgs/postgresql/files/postgresql-initdb
Normal file
33
srcpkgs/postgresql/files/postgresql-initdb
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. /etc/default/postgresql
|
||||
|
||||
# 2nd clause is necessary to prevent symlinking the directory to itself when it
|
||||
# doesn't exist yet
|
||||
if [ "$PGROOT" != "/var/lib/postgresql" ]; then
|
||||
echo "Creating symlink /var/lib/postgresql -> $PGROOT"
|
||||
|
||||
# Remove /var/lib/postgres if empty dir, but not if symlink
|
||||
if [ ! -L /var/lib/postgres ] && [ -d /var/lib/postgres ]; then
|
||||
rmdir /var/lib/postgres
|
||||
fi
|
||||
|
||||
ln -sf "$PGROOT" /var/lib/postgresql
|
||||
fi
|
||||
|
||||
PGDATA="$PGROOT/data"
|
||||
|
||||
if [ ! -d "$PGDATA" ]; then
|
||||
echo "Initializing database in $PGDATA"
|
||||
|
||||
mkdir -p "$PGDATA"
|
||||
chown -R postgres:postgres "$PGDATA"
|
||||
|
||||
su - postgres -m -c "/usr/bin/initdb $INITOPTS -D '$PGDATA'" >/dev/null
|
||||
|
||||
if [ -f /etc/postgresql/postgresql.conf ]; then
|
||||
ln -sf /etc/postgresql/postgresql.conf "$PGDATA/postgresql.conf"
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue