]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
wip sysusers
authorDaniel Salzman <daniel.salzman@nic.cz>
Mon, 20 Oct 2025 10:44:55 +0000 (12:44 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Thu, 23 Oct 2025 07:04:20 +0000 (09:04 +0200)
distro/common/knot.sysusers.conf [new file with mode: 0644]
distro/common/knot.tmpfiles [new file with mode: 0644]
distro/pkg/deb-nolibxdp/control
distro/pkg/deb-nolibxdp/knot.sysusers.conf [new symlink]
distro/pkg/deb-nolibxdp/knot.tmpfiles [new symlink]
distro/pkg/deb/control
distro/pkg/deb/knot.postinst
distro/pkg/deb/knot.postrm
distro/pkg/deb/knot.sysusers.conf [new symlink]
distro/pkg/deb/knot.tmpfiles [new symlink]

diff --git a/distro/common/knot.sysusers.conf b/distro/common/knot.sysusers.conf
new file mode 100644 (file)
index 0000000..7adade6
--- /dev/null
@@ -0,0 +1 @@
+u! knot - - /var/lib/knot
diff --git a/distro/common/knot.tmpfiles b/distro/common/knot.tmpfiles
new file mode 100644 (file)
index 0000000..3bd4686
--- /dev/null
@@ -0,0 +1,3 @@
+d /var/lib/knot       0770 root knot
+d /etc/knot           0750 root knot
+f /etc/knot/knot.conf 0640 root knot
index b60928b5b79dc0d13bf5d6c96a822a69e233cd19..1610c548f141aeb67cf48e0d3b81c036c68904f8 100644 (file)
@@ -13,6 +13,7 @@ Build-Depends:
  automake,
  debhelper (>= 11),
  dh-python,
+ dh-sequence-installsysusers,
  libbpf-dev,
  libcap-ng-dev,
  libedit-dev,
@@ -40,7 +41,6 @@ Vcs-Git: https://gitlab.nic.cz/knot/knot-dns.git
 Package: knot
 Architecture: any
 Depends:
- adduser,
  libdnssec10 (= ${binary:Version}),
  libknot16 (= ${binary:Version}),
  libzscanner5 (= ${binary:Version}),
diff --git a/distro/pkg/deb-nolibxdp/knot.sysusers.conf b/distro/pkg/deb-nolibxdp/knot.sysusers.conf
new file mode 120000 (symlink)
index 0000000..aa4c690
--- /dev/null
@@ -0,0 +1 @@
+../deb/knot.sysusers.conf
\ No newline at end of file
diff --git a/distro/pkg/deb-nolibxdp/knot.tmpfiles b/distro/pkg/deb-nolibxdp/knot.tmpfiles
new file mode 120000 (symlink)
index 0000000..c2216c1
--- /dev/null
@@ -0,0 +1 @@
+../deb/knot.tmpfiles
\ No newline at end of file
index 32f42080e22ec31805a8510568c65be484bd87d9..9a2f0a6db271872ae2c5326386667d6e6ba7cfdd 100644 (file)
@@ -14,6 +14,7 @@ Build-Depends:
  automake,
  debhelper (>= 11),
  dh-python,
+ dh-sequence-installsysusers,
  libbpf-dev,
  libcap-ng-dev,
  libedit-dev,
@@ -43,7 +44,6 @@ Vcs-Git: https://gitlab.nic.cz/knot/knot-dns.git
 Package: knot
 Architecture: any
 Depends:
- adduser,
  libdnssec10 (= ${binary:Version}),
  libknot16 (= ${binary:Version}),
  libzscanner5 (= ${binary:Version}),
index da747c8263a164479052f53933b31ec56595098a..9ed7222619b43baee168315179419d3bf03eba7c 100644 (file)
@@ -1,16 +1,14 @@
 #!/bin/sh
 set -e
 
-if [ "$1" = "configure" ]; then
-    if ! getent passwd knot > /dev/null; then
-        adduser --quiet --system --group --no-create-home --home /var/lib/knot knot
-    fi
+# Ensure sysusers.d/tmpfiles.d are applied before statoverride runs
+
+#DEBHELPER#
 
+if [ "$1" = "configure" ]; then
     dpkg-statoverride --list /var/lib/knot >/dev/null 2>&1 || dpkg-statoverride --update --add root knot 0770 /var/lib/knot
     dpkg-statoverride --list /etc/knot/knot.conf >/dev/null 2>&1 || dpkg-statoverride --update --add root knot 0640 /etc/knot/knot.conf
     dpkg-statoverride --list /etc/knot >/dev/null 2>&1 || dpkg-statoverride --update --add root knot 0750 /etc/knot
 fi
 
-#DEBHELPER#
-
 exit 0
index 14b3d69b6291ea5e3d73298b7bc345b9f535aa2b..c3b5f9584244362051b2ac08a320491eb0089f4d 100644 (file)
@@ -12,8 +12,6 @@ if test "$1" = "purge"; then
     dpkg-statoverride --remove /var/lib/knot >/dev/null 2>&1 || true
     dpkg-statoverride --remove /etc/knot/knot.conf >/dev/null 2>&1 || true
     dpkg-statoverride --remove /etc/knot >/dev/null 2>&1 || true
-
-    deluser --quiet knot >/dev/null 2>&1 || true
 fi
 
 #DEBHELPER#
diff --git a/distro/pkg/deb/knot.sysusers.conf b/distro/pkg/deb/knot.sysusers.conf
new file mode 120000 (symlink)
index 0000000..3432896
--- /dev/null
@@ -0,0 +1 @@
+../../common/knot.sysusers.conf
\ No newline at end of file
diff --git a/distro/pkg/deb/knot.tmpfiles b/distro/pkg/deb/knot.tmpfiles
new file mode 120000 (symlink)
index 0000000..76b7acf
--- /dev/null
@@ -0,0 +1 @@
+../../common/knot.tmpfiles
\ No newline at end of file