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

index 0736fe31049b68f942060a441e95a76fb4cfeca2..56bb3aaa071273a2430929f4eaf1a40b6a5840ec 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = lldpd
 version    = 1.0.16
-release    = 2
+release    = 3
 
 groups     = Networking/Tools
 url        = https://lldpd.github.io
@@ -28,6 +28,7 @@ build
                pkg-config
                readline-devel
                shadow-utils
+               systemd-sysusers
        end
 
        configure_options += \
@@ -43,29 +44,10 @@ build
        else
                configure_options += --with-seccomp
        end
-
-       prepare_cmds
-               %{create_user}
-       end
-end
-
-create_user
-       getent group lldpd >/dev/null || groupadd -r lldpd
-       getent passwd lldpd >/dev/null || \
-               useradd -r -g lldpd -d / -s /sbin/nologin lldpd
 end
 
 packages
        package %{name}
-               prerequires
-                       shadow-utils
-                       systemd-units
-               end
-
-               script prein
-                       %{create_user}
-               end
-
                script postin
                        /bin/systemctl daemon-reload >/dev/null 2>&1 || :
                end
diff --git a/lldpd/lldpd.sysusers b/lldpd/lldpd.sysusers
new file mode 100644 (file)
index 0000000..05c1957
--- /dev/null
@@ -0,0 +1 @@
+u lldpd - "User for lldpd service" / /usr/sbin/nologin