Skip to content

dh_installinit: Remove the executable bits on package removal / dh_installsystemd: No longer mask system units on package removal

Michael Biebl requested to merge biebl/debhelper:dh_installsystemd-no-mask into main

If a package shipping a SysV init script is removed, but not purged, remove the executable bit of the SysV init script as an indicator that this script should not be run during boot anymore.

For a package that is shipping both a SysV init script and a native systemd service file, the systemd service file will automatically take precedence and the SysV init script is ignored. As SysV init scripts are conffiles though and systemd service files are not, for a package that is removed but not purged, the SysV init script suddenly becomes active because of that. This behaviour is undesirable, so in the past we created a mask on package removal. This created its own set of problems.

Fortunately, a much more robust solution exists. systemd-sysv-generator will ignore any SysV init scripts, which do not have the x-bit set. So remove that via dh_installinit on package removal and drop the corresponding masking code from dh_installsystemd.

As there still might be old uninstalled but not purged packages out in the wild, keep the unmasking code for a while longer. It should be dropped eventually though, so update the comments in the code accordingly.

Edited by Michael Biebl

Merge request reports

Loading