Use systemd-sysusers to setup systemd users and groups

This commit is contained in:
Luca Boccassi 2021-02-17 18:50:31 +01:00
parent e7f6286096
commit fa0aade329
7 changed files with 2 additions and 30 deletions

6
debian/control vendored
View File

@ -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 <!nodoc>,
@ -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,

View File

@ -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

View File

@ -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#

View File

@ -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#

View File

@ -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

View File

@ -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

View File

@ -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"