Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1021027: dh_installsystemd: do not mask/unmask any unit files besides services

37 views
Skip to first unread message

Michael Biebl

unread,
Sep 30, 2022, 12:50:04 PM9/30/22
to
Package: debhelper
Version: 13.9.1
Severity: normal
X-Debbugs-Cc: pkg-systemd...@lists.alioth.debian.org

dh_installsystemd currently creates a maintscript code to mask/unmask any
type of unit files (.service, .socket, .timer, etc) if a package is
removed/(re)installed.

The masking/unmasking is currently done as packages unfortunately still
ship SysV init scripts along side native unit files and as SysV init
scripts are typically conffiles, they are not removed on uninstall.
So unless the package is purged systemd-sysv-generator will now see a
SysV init script and generate a corresponding runtime unit for it.

Ideally, we would not have to manually create those masks.
At least we shouldn't do it for non-service units as this can lead to
failures e.g. when socket units that are used in a service are still
masked.

Example:
# apt install -y systemd-oomd; apt remove -y systemd-oomd; apt install -y systemd-oomd
...
Setting up systemd-oomd (251.4-3) ...
Failed to restart systemd-oomd.service: Unit systemd-oomd.socket is masked.
Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 145.


dh_installsystemd should probably create two lists:
#UNITFILES# and #SERVICEFILES#
and the autoscripts for systemd doing the mask/unmask should only
operate on #SERVICEFILES#

There's the problem of existing masks, so we will probably need to
create the unmask code in postinst for #UNITFILES# at least for a while
longer.

Michael




-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.19.0-2-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages debhelper depends on:
ii autotools-dev 20220109.1
ii dh-autoreconf 20
ii dh-strip-nondeterminism 1.13.0-1
ii dpkg 1.21.9
ii dpkg-dev 1.21.9
ii dwz 0.14+20220924-2
ii file 1:5.41-4
ii libdebhelper-perl 13.9.1
ii libdpkg-perl 1.21.9
ii man-db 2.10.2-3
ii perl 5.34.0-5
ii po-debconf 1.0.21+nmu1

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii dh-make 2.202203

-- no debconf information

Michael Biebl

unread,
Sep 30, 2022, 1:10:04 PM9/30/22
to
Am 30.09.22 um 18:45 schrieb Michael Biebl:
Another idea how we could drop the need for the masks is to let
dh_installinit generate a "chmod -x /etc/init.d/foo" upon package
removal (and running a corresponding chmod +x on reinstall).
systemd-sysv-generator already helpfully ignores any non-executable
files in /etc/init.d

What do others think about this idea?

Getting rid of the mask/unmask bandaid would be really beneficial.

Regards,
Michael

OpenPGP_signature

Luca Boccassi

unread,
Sep 30, 2022, 1:10:04 PM9/30/22
to
I like that, sounds simple, low-risk and effective

--
Kind regards,
Luca Boccassi
signature.asc

Michael Biebl

unread,
Oct 1, 2022, 6:50:14 AM10/1/22
to
Am 30.09.22 um 19:05 schrieb Luca Boccassi:
https://salsa.debian.org/debian/debhelper/-/merge_requests/90

Comments welcome.

OpenPGP_signature
0 new messages