--- /usr/lib/systemd/scripts/postgresql-initdb 2012-06-09 18:35:54.000000000 +0100 +++ postgresql-initdb.new 2012-06-12 10:28:36.241538937 +0100 @@ -4,9 +4,13 @@ . /etc/conf.d/postgresql +if [ -z "$PGROOT" ]; then + PGROOT=/var/lib/postgres +fi # 2nd clause is necessary to prevent symlinking the directory to itself when it # doesn't exist yet if [ ! /var/lib/postgres -ef "$PGROOT" ] && [ /var/lib/postgres != "$PGROOT" ]; then + echo "Creating symlink /var/lib/postgres -> $PGROOT" # Remove /var/lib/postgres if empty dir, but not if symlink