From: Antoine Joubert Date: Mon, 16 Dec 2019 16:57:13 +0000 (+0100) Subject: rec: debian postinst / do not fail on user creation if it already exists X-Git-Tag: auth-4.3.0-beta1~43^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8639%2Fhead;p=thirdparty%2Fpdns.git rec: debian postinst / do not fail on user creation if it already exists --- diff --git a/builder-support/debian/recursor/debian-buster/pdns-recursor.postinst b/builder-support/debian/recursor/debian-buster/pdns-recursor.postinst index c4a755daad..4e1da70992 100644 --- a/builder-support/debian/recursor/debian-buster/pdns-recursor.postinst +++ b/builder-support/debian/recursor/debian-buster/pdns-recursor.postinst @@ -3,8 +3,12 @@ set -e case "$1" in configure) - addgroup --system pdns - adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns + if [ -z "`getent group pdns`" ]; then + addgroup --system pdns + fi + if [ -z "`getent passwd pdns`" ]; then + adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns + fi if [ "`stat -c '%U:%G' /etc/powerdns/recursor.conf`" = "root:root" ]; then chown root:pdns /etc/powerdns/recursor.conf # Make sure that pdns can read it; the default used to be 0600 diff --git a/builder-support/debian/recursor/debian-jessie/pdns-recursor.postinst b/builder-support/debian/recursor/debian-jessie/pdns-recursor.postinst index c4a755daad..4e1da70992 100644 --- a/builder-support/debian/recursor/debian-jessie/pdns-recursor.postinst +++ b/builder-support/debian/recursor/debian-jessie/pdns-recursor.postinst @@ -3,8 +3,12 @@ set -e case "$1" in configure) - addgroup --system pdns - adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns + if [ -z "`getent group pdns`" ]; then + addgroup --system pdns + fi + if [ -z "`getent passwd pdns`" ]; then + adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns + fi if [ "`stat -c '%U:%G' /etc/powerdns/recursor.conf`" = "root:root" ]; then chown root:pdns /etc/powerdns/recursor.conf # Make sure that pdns can read it; the default used to be 0600 diff --git a/builder-support/debian/recursor/debian-stretch/pdns-recursor.postinst b/builder-support/debian/recursor/debian-stretch/pdns-recursor.postinst index c4a755daad..4e1da70992 100644 --- a/builder-support/debian/recursor/debian-stretch/pdns-recursor.postinst +++ b/builder-support/debian/recursor/debian-stretch/pdns-recursor.postinst @@ -3,8 +3,12 @@ set -e case "$1" in configure) - addgroup --system pdns - adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns + if [ -z "`getent group pdns`" ]; then + addgroup --system pdns + fi + if [ -z "`getent passwd pdns`" ]; then + adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns + fi if [ "`stat -c '%U:%G' /etc/powerdns/recursor.conf`" = "root:root" ]; then chown root:pdns /etc/powerdns/recursor.conf # Make sure that pdns can read it; the default used to be 0600