Bug 49607 - Update of univention-base-files triggers network restart
Update of univention-base-files triggers network restart
Status: NEW
Product: UCS
Classification: Unclassified
Component: univention-base-files
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: UCS maintainers
UCS maintainers
:
Depends on: 47701
Blocks:
  Show dependency treegraph
 
Reported: 2019-06-06 16:11 CEST by Philipp Hahn
Modified: 2021-04-28 10:22 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.103
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019060521000629
Bug group (optional): API change
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2019-06-06 16:11:17 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.
Comment 1 Philipp Hahn univentionstaff 2019-06-06 16:33:25 CEST
<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.
Comment 2 Philipp Hahn univentionstaff 2021-04-28 10:21:52 CEST
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.