]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: debian postinst / do not fail on user creation if it already exists 8639/head
authorAntoine Joubert <antoine.joubert@nameshield.net>
Mon, 16 Dec 2019 16:57:13 +0000 (17:57 +0100)
committerAntoine Joubert <antoine.joubert@nameshield.net>
Mon, 16 Dec 2019 16:57:13 +0000 (17:57 +0100)
builder-support/debian/recursor/debian-buster/pdns-recursor.postinst
builder-support/debian/recursor/debian-jessie/pdns-recursor.postinst
builder-support/debian/recursor/debian-stretch/pdns-recursor.postinst

index c4a755daadc28eb56ed6e31e51fe5b252bab74bd..4e1da7099252129ed5d1b5683cd92ee006ce0983 100644 (file)
@@ -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
index c4a755daadc28eb56ed6e31e51fe5b252bab74bd..4e1da7099252129ed5d1b5683cd92ee006ce0983 100644 (file)
@@ -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
index c4a755daadc28eb56ed6e31e51fe5b252bab74bd..4e1da7099252129ed5d1b5683cd92ee006ce0983 100644 (file)
@@ -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