Am 30.09.22 um 18:45 schrieb Michael Biebl:
Package: debhelper Version: 13.9.1 Severity: normal X-Debbugs-Cc: pkg-systemd-maintain...@lists.alioth.debian.orgdh_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.
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
Description: OpenPGP digital signature