Commit 46c42d80 authored by Christoph Berg's avatar Christoph Berg

Create the postgres group when missing, and add the postgres user to it.

Could happen when the postgres user was created manually.
parent 0abec6c2
postgresql-common (150) UNRELEASED; urgency=low
* Create the postgres group when missing, and add the postgres user to it.
Could happen when the postgres user was created manually.
-- Christoph Berg <myon@debian.org> Sun, 29 Sep 2013 13:23:50 +0200
postgresql-common (149) unstable; urgency=low
* debian/supported-versions: Set default version to 9.3. Drop 9.2 from
......
......@@ -12,6 +12,14 @@ if [ "$1" = configure ]; then
adduser --system --quiet --home /var/lib/postgresql --no-create-home \
--shell /bin/bash --group --gecos "PostgreSQL administrator" postgres
fi
# if the user was created manually, make sure the group is there as well
if ! getent group postgres > /dev/null; then
addgroup --system --quiet postgres
fi
# make sure postgres is in the postgres group
if ! id -Gn postgres | grep -qw postgres; then
adduser --quiet postgres postgres
fi
# check validity of postgres user and group
if [ "`id -u postgres`" -eq 0 ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment