Problem: Update to UCS v4.4 Fails With Errors Related to bind9 And samba-ad-dc Packages

upgrade
ucs-4-3
problem
ucs-4-4

#1

Problem

Update to UCS v4.4 fails with errors related to bind9 and samba-ad-dc packages
The update process fails with an error and you will see in /var/log/univention/updater.log:

bind9 (1:9.10.3.dfsg.P4-12.3+deb9u5A~4.4.0.201905131414) wird eingerichtet ... 
insserv: Service samba-ad-dc has to be enabled to start service bind9 
insserv: exiting now! 
update-rc.d: error: insserv rejected the script header

This error might happen as well to other packages as bind9.

Investigation

This issue only happens on upgraded UCS systems having been on UCS 4.2.x earlier with the unmaintained repository enabled.
Root cause is the change from SysV init scripts to systemd in UCS 4.3. For UCS 4.3 the packages containing the SysV scripts move to unmaintained. But when being installed they do not get removed. Now upgrading bind9 checks if insserv packages are installed and updates these packages but they do not contain proper dependencies to up-to-date sysV init.

Solution

For new setups this will not happen as these packages are not installed. To prevent such issues there have been two fixes (fix1 and fix2) announced for UCS 4.3.
If you already run into this issue your can get through it with the following commands:

rm -f /etc/rcS.d/S??mountkernfs.sh
sed -i -e '/^Required-St/s/samba-ad-dc//' /etc/init.d/bind9
dpkg --configure -a
ucr set repository/online/unmaintained=no
apt remove insserv
apt remove initscripts

Then start the upgrade again.