aboutsummaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2026-07-07 23:26:17 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2026-07-07 23:26:17 +0100
commit884afd866f5138f5a400ab2cc754fa96df74cd88 (patch)
treeab05bcda33a1d8b3f59cb6871e72f6d409c63b1b /debian
parent61c7869ddd55369b1a652b5fafb8f27215c6c9dd (diff)
Install and use sysusers.d config files
sysusers.d config files allow a package to use declarative configuration instead of manually written maintainer scripts. This also allows image-based systems to be created with /usr/ only, and also allows for factory resetting a system and recreating /etc/ on boot. https://www.freedesktop.org/software/systemd/man/latest/sysusers.d.html Note that this does not require a hard dependency on systemd, debhelper generates depetencies correctly so that they work out of the box on non-systemd and non-linux Debian builds seamlessly.
Diffstat (limited to 'debian')
-rw-r--r--debian/control5
-rwxr-xr-xdebian/lacme.postinst21
-rw-r--r--debian/lacme.sysusers2
3 files changed, 4 insertions, 24 deletions
diff --git a/debian/control b/debian/control
index cf41ba9..5854a15 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: lacme
Section: utils
Priority: optional
Maintainer: Guilhem Moulin <guilhem@debian.org>
-Build-Depends: debhelper-compat (= 13), jq, pandoc (>= 2.1~)
+Build-Depends: debhelper-compat (= 13), dh-sequence-installsysusers, jq, pandoc (>= 2.1~)
Rules-Requires-Root: no
Standards-Version: 4.7.0
Homepage: https://git.guilhem.org/lacme/about/
@@ -11,8 +11,7 @@ Vcs-Browser: https://salsa.debian.org/debian/lacme
Package: lacme
Architecture: all
-Depends: adduser,
- libconfig-tiny-perl,
+Depends: libconfig-tiny-perl,
libjson-perl,
libnet-ssleay-perl,
libtimedate-perl,
diff --git a/debian/lacme.postinst b/debian/lacme.postinst
deleted file mode 100755
index 536e37f..0000000
--- a/debian/lacme.postinst
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "configure" ]; then
- if ! getent passwd _lacme-www >/dev/null; then
- adduser --force-badname --system \
- --home /nonexistent --no-create-home \
- --gecos "lacme www user" \
- --quiet _lacme-www || true
- fi
- if ! getent passwd _lacme-client >/dev/null; then
- adduser --force-badname --system \
- --home /nonexistent --no-create-home \
- --gecos "lacme client user" \
- --quiet _lacme-client || true
- fi
-fi
-
-#DEBHELPER#
-exit 0
diff --git a/debian/lacme.sysusers b/debian/lacme.sysusers
new file mode 100644
index 0000000..2134456
--- /dev/null
+++ b/debian/lacme.sysusers
@@ -0,0 +1,2 @@
+u! _lacme-www -:nogroup "lacme www user" /nonexistent
+u! _lacme-client -:nogroup "lacme client user" /nonexistent