From 884afd866f5138f5a400ab2cc754fa96df74cd88 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 7 Jul 2026 23:26:17 +0100 Subject: 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. --- debian/control | 5 ++--- debian/lacme.postinst | 21 --------------------- debian/lacme.sysusers | 2 ++ 3 files changed, 4 insertions(+), 24 deletions(-) delete mode 100755 debian/lacme.postinst create mode 100644 debian/lacme.sysusers 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 -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 -- cgit v1.2.3