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

index dee396f5db58d188329384690c92410d29251257..e513f04c7cbf54888963ea65752cd7dd36ce0433 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = unbound
 version    = 1.17.0
-release    = 4
+release    = 5
 
 groups     = System/Daemons
 url        = https://www.nlnetlabs.nl/unbound/
@@ -29,6 +29,7 @@ build
                openssl-devel >= 1.0.1h-2
                python3-devel >= 3.4
                swig
+               systemd-sysusers
        end
 
        configure_options += \
@@ -44,10 +45,6 @@ build
                --with-pythonmodule \
                --with-pyunbound PYTHON=%{python3}
 
-       prepare_cmds
-               %{create_user}
-       end
-
        test
                make check
        end
@@ -86,19 +83,8 @@ build
        end
 end
 
-create_user
-       getent group unound >/dev/null || /usr/sbin/groupadd -r unbound
-       getent passwd unbound >/dev/null || /usr/sbin/useradd -r -g unbound \
-               -d %{sysconfdir}/%{name} -s /sbin/nologin unbound
-end
-
 packages
        package %{name}
-               prerequires
-                       shadow-utils
-                       systemd-units
-               end
-
                requires += \
                        openssl >= 1.0.1h-2
 
@@ -112,10 +98,6 @@ packages
                        %{sysconfdir}/%{name}/keys.d/
                end
 
-               script prein
-                       %{create_user}
-               end
-
                script postin
                        /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 
diff --git a/unbound/unbound.sysusers b/unbound/unbound.sysusers
new file mode 100644 (file)
index 0000000..aef3ede
--- /dev/null
@@ -0,0 +1 @@
+u unbound - "User for the unbound DNS resolver" /etc/unbound /usr/sbin/nologin