]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/commitdiff
pdns: Switch to systemd sysusers mechanism for user/group creation
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 11 Apr 2023 14:00:23 +0000 (16:00 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Tue, 11 Apr 2023 14:00:23 +0000 (16:00 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
pdns/pdns.nm
pdns/pdns.sysusers [new file with mode: 0644]

index 7fcaa64cd85a80def0803b12855f9e4f93f29103..d4007408990c134b7ee6550a27ce574da6f1bfb1 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = pdns
 version    = 4.7.3
-release    = 1
+release    = 2
 thisapp    = %{name}-%{version}
 
 groups     = Networking/DNS
@@ -38,6 +38,7 @@ build
                shadow-utils
                sqlite-devel
                systemd-devel
+               systemd-sysusers
                zlib-devel
        end
 
@@ -54,10 +55,6 @@ build
                --enable-unit-tests \
                --disable-static
 
-       prepare_cmds
-               %{create_user}
-       end
-
        test
                make -C pdns check || :
        end
@@ -88,18 +85,10 @@ build
        end
 end
 
-create_user
-       getent group pdns >/dev/null || groupadd -r pdns
-       getent passwd pdns >/dev/null || \
-       useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
-               -c "PowerDNS user" pdns
-end
-
 packages
        package %{name}
                prerequires
                        coreutils
-                       shadow-utils
                        sqlite
                end
 
@@ -111,10 +100,6 @@ packages
                        %{sharedstatedir}/pdns/pdns.db
                end
 
-               script prein
-                       %{create_user}
-               end
-
                script postin
                        systemctl daemon-reload >/dev/null 2>&1 || :
 
diff --git a/pdns/pdns.sysusers b/pdns/pdns.sysusers
new file mode 100644 (file)
index 0000000..43c21ea
--- /dev/null
@@ -0,0 +1 @@
+u pdns - "User for PowerDNS" /var/lib/pdns /usr/sbin/nologin