From fa0aade329409fb1c43a0ef73ee8bf8227c82bfe Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 17 Feb 2021 18:50:31 +0100 Subject: [PATCH] Use systemd-sysusers to setup systemd users and groups --- debian/control | 6 +----- debian/systemd-coredump.postinst | 3 --- debian/systemd-journal-remote.postinst | 10 ---------- debian/systemd-oomd.postinst | 5 +---- debian/systemd-resolved.postinst | 2 -- debian/systemd-timesyncd.postinst | 3 --- debian/systemd.postinst | 3 --- 7 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 debian/systemd-journal-remote.postinst diff --git a/debian/control b/debian/control index 5301fa4aa..3a43864fd 100644 --- a/debian/control +++ b/debian/control @@ -16,6 +16,7 @@ Homepage: https://www.freedesktop.org/wiki/Software/systemd Build-Depends: debhelper-compat (= 13), dh-exec, dh-sequence-installnss, + dh-sequence-installsysusers, dh-sequence-package-notes, pkg-config, xsltproc , @@ -162,7 +163,6 @@ Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends}, systemd, - adduser Description: tools for sending and receiving remote journal logs This package provides tools for sending and receiving remote journal logs: * systemd-journal-remote @@ -175,7 +175,6 @@ Architecture: linux-any Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends}, - adduser, systemd Recommends: libdw1 Conflicts: core-dump-handler @@ -192,7 +191,6 @@ Multi-Arch: foreign Priority: standard Depends: ${shlibs:Depends}, ${misc:Depends}, - adduser, systemd Breaks: systemd (<< 245.4-2~), Conflicts: time-daemon @@ -432,7 +430,6 @@ Package: systemd-oomd Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends}, - adduser, Breaks: systemd (<< 250.2-2~) Replaces: systemd (<< 250.2-2~) Description: userspace out-of-memory (OOM) killer @@ -506,7 +503,6 @@ Architecture: linux-any Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, - adduser, systemd (= ${binary:Version}), default-dbus-system-bus | dbus-system-bus Recommends: libnss-myhostname, diff --git a/debian/systemd-coredump.postinst b/debian/systemd-coredump.postinst index 1b93506d3..259c2b351 100644 --- a/debian/systemd-coredump.postinst +++ b/debian/systemd-coredump.postinst @@ -3,9 +3,6 @@ set -e if [ "$1" = configure ]; then - adduser --quiet --system --group --no-create-home --home /run/systemd \ - --gecos "systemd Core Dumper" systemd-coredump - # enable systemd-coredump right after package installation if [ -d /run/systemd/system ]; then systemctl daemon-reload && systemctl start systemd-coredump.socket || true diff --git a/debian/systemd-journal-remote.postinst b/debian/systemd-journal-remote.postinst deleted file mode 100644 index 8ef91ada9..000000000 --- a/debian/systemd-journal-remote.postinst +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -adduser --quiet --system \ - --home /run/systemd --no-create-home \ - --gecos "systemd Journal Remote" \ - --group systemd-journal-remote - -#DEBHELPER# diff --git a/debian/systemd-oomd.postinst b/debian/systemd-oomd.postinst index d22acfc55..65629b77b 100644 --- a/debian/systemd-oomd.postinst +++ b/debian/systemd-oomd.postinst @@ -2,8 +2,7 @@ set -e -adduser --quiet --system --group --no-create-home --home /run/systemd \ - --gecos "systemd Userspace OOM Killer" systemd-oom +#DEBHELPER# # reload dbus configuration to make the new org.freedesktop.oom1 API available # The org.freedesktop.oom1.conf policy references the 'systemd-oom' user, thus @@ -11,5 +10,3 @@ adduser --quiet --system --group --no-create-home --home /run/systemd \ if [ -d /run/systemd/system ]; then systemctl reload dbus || true fi - -#DEBHELPER# diff --git a/debian/systemd-resolved.postinst b/debian/systemd-resolved.postinst index ab964c0cc..07518ba80 100644 --- a/debian/systemd-resolved.postinst +++ b/debian/systemd-resolved.postinst @@ -20,8 +20,6 @@ _adopt_conffile() { if [ "$1" = configure ] && [ -z "$2" ]; then - adduser --quiet --system --group --no-create-home --home /run/systemd \ - --gecos "systemd Resolver" systemd-resolve _adopt_conffile "${DPKG_ROOT}/etc/systemd/resolved.conf" systemd-resolved fi diff --git a/debian/systemd-timesyncd.postinst b/debian/systemd-timesyncd.postinst index c09821689..608f54bdc 100644 --- a/debian/systemd-timesyncd.postinst +++ b/debian/systemd-timesyncd.postinst @@ -18,9 +18,6 @@ _adopt_conffile() { fi } -adduser --quiet --system --group --no-create-home --home /run/systemd \ - --gecos "systemd Time Synchronization" systemd-timesync - if [ "$1" = configure ] && [ -z "$2" ]; then _adopt_conffile /etc/dhcp/dhclient-exit-hooks.d/timesyncd systemd-timesyncd _adopt_conffile /etc/systemd/timesyncd.conf systemd-timesyncd diff --git a/debian/systemd.postinst b/debian/systemd.postinst index 05f643fe3..fb24c46b4 100644 --- a/debian/systemd.postinst +++ b/debian/systemd.postinst @@ -53,9 +53,6 @@ fi # Create /etc/machine-id systemd-machine-id-setup ${DPKG_ROOT:+--root="$DPKG_ROOT"} -# Setup system users and groups -systemd-sysusers ${DPKG_ROOT:+--root="$DPKG_ROOT"} systemd-journal.conf systemd-network.conf - # Enable persistent journal, in auto-mode, by default on new installs and upgrades if dpkg --compare-versions "$2" lt "244.1-2~"; then mkdir -p "$DPKG_ROOT/var/log/journal"