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: rec-4.2.2~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8674%2Fhead;p=thirdparty%2Fpdns.git rec: debian postinst / do not fail on user creation if it already exists (cherry picked from commit fddad2718fb994d4fd016c03e1e05ef6c67aae14) --- diff --git a/builder-support/debian/recursor/debian-buster/pdns-recursor.postinst b/builder-support/debian/recursor/debian-buster/pdns-recursor.postinst index 1c32de2854..ae925a6cf0 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 ;; *) diff --git a/builder-support/debian/recursor/debian-jessie/pdns-recursor.postinst b/builder-support/debian/recursor/debian-jessie/pdns-recursor.postinst index 1c32de2854..ae925a6cf0 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 ;; *) diff --git a/builder-support/debian/recursor/debian-stretch/pdns-recursor.postinst b/builder-support/debian/recursor/debian-stretch/pdns-recursor.postinst index 1c32de2854..ae925a6cf0 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 ;; *)