Univention Bugzilla – Bug 49607
Update of univention-base-files triggers network restart
Last modified: 2021-04-28 10:22:19 CEST
+++ This bug was initially created as a clone of Bug #47701 +++ During the package update "univention-base-files.postinst" does a ucr register univention-base-files which triggers /etc/network/interfaces being re-generated. The file has a pre- and post-hook "interfaces.py" registered, which restarts the network, even when no UCRV is changed: > Multifile: /etc/network/interfaces > changes: {'UCRWARNING=# ': None, 'ipv6/gateway': None, 'interfaces/restart/auto': None, 'interfaces/handler': 'ifplugd', 'interfaces/primary': 'eth0', 'interfaces/[^/]*/.*': None, 'gateway': '10.200.17.1'} > ifdown -a ... > Restarting univention-s4-connector (via systemctl): univention-s4-connector.service. > changes: {'UCRWARNING=# ': None, 'ipv6/gateway': None, 'interfaces/restart/auto': None, 'interfaces/handler': 'ifplugd', 'interfaces/primary': 'eth0', 'interfaces/[^/]*/.*': None, 'gateway': '10.200.17.1'} > ifup -a In the customers case this lead to all VMs being dis-connected from the bridge, which has been fixed by Bug #47701. But still UCR should only re-generate changed files and call their hooks, not always.
<https://docs.software-univention.de/developer-reference-4.4.html#ucr:file> is wrong: > def preinst(config_registry, changes): > pass > def postinst(config_registry, changes): > pass > ... The second argument changes is a dictionary of 2-tuples, which maps the names of all changed variables to (old-value, new-value). In case of "ucr register" "changes" is a dict mapping from "UCR variable name regular expression" to "current value"; as the regexp is not evaluated and applied, this leads to: > 'interfaces/[^/]*/.*': None This is partly the cause for this issue as "interfaces.py" walks over all "changed" UCRV and tries to map them to their respective interfaces. As "gateway" is (always) included, "ifupdown -a" is called.
For UCS-5 this is no longer that important because we no longer have UVMM. For UCS-5 there also was a change in UCR via Bug #52847 to call handlers only for changed values: Re-check if re-installing univention-base-files is still problematic.