Univention Bugzilla – Bug 36532
Changing network settings is slow
Last modified: 2017-12-12 13:09:04 CET
If I change network settings via UCR, services are restarted many times which currently leads to a fairly long waiting time (1min 20sec in the example log from setup.log below): -------------------- 8< -------------------- === 30_net/12gateway (2014-11-06 15:53:06) === __NAME__:30_net/12gateway Setting IPv4 gateway Stopping NTP server: ntpd. Restarting Name Service Cache Daemon: nscd. Restarting bind9 daemon: . done. Restarting Name Service Cache Daemon: nscd. Restarting bind9 daemon: . done. Restarting univention-directory-listener daemon. ok: run: univention-directory-listener: (pid 26601) 0s, normally down done. Restarting univention-directory-notifier daemon: . ok: run: univention-directory-notifier: (pid 26620) 0s, normally down done. Stopping univention-s4-connector daemon. done. Starting univention-s4-connector daemon. done. Restarting Name Service Cache Daemon: nscd. Restarting bind9 daemon: . done. Restarting univention-directory-listener daemon. ok: run: univention-directory-listener: (pid 26813) 1s, normally down done. Restarting univention-directory-notifier daemon: . ok: run: univention-directory-notifier: (pid 26829) 0s, normally down done. Stopping univention-s4-connector daemon. done. Starting univention-s4-connector daemon. done. Restarting univention-directory-listener daemon. ok: run: univention-directory-listener: (pid 26927) 0s, normally down done. Restarting univention-directory-notifier daemon: . ok: run: univention-directory-notifier: (pid 26946) 0s, normally down done. Stopping univention-s4-connector daemon. done. Starting univention-s4-connector daemon. done. File: /etc/dhcp/dhclient.conf Restarting bind9 daemon: . done. File: /etc/dhcp/dhclient.conf Starting NTP server: ntpd. Restarting Name Service Cache Daemon: nscd. Restarting bind9 daemon: . done. Restarting Name Service Cache Daemon: nscd. Setting gateway Multifile: /etc/network/interfaces === 30_net/13ipv6gateway (2014-11-06 15:54:26) === -------------------- 8< -------------------- At the moment, the UCR network values are also set in the appliance wizard in the network page which may lead to a waiting time of 4-10sec (Bug 36110, comment 9). It would be great if we could speed this up!
(In reply to Alexander Kläser from comment #0) > [...] > At the moment, the UCR network values are also set in the appliance wizard > in the network page which may lead to a waiting time of 4-10sec (Bug 36110, > comment 9). With up-to-date appliance images, it actually takes much longer (maybe 30-40sec).
It would also be great to query the (at least rough) progress state in order to display this information to the user via UMC.
r56682 | Bug #36532 Net: Fix ifupdown -a handling
Also: when going 'back' to the network page and clicking on 'next' without doing any change the network settings are applied again. This should not be done.
1. univention-directory-notifier, univention-directory-listener, univention-bind9 are restarted multiple times. As this currently is synchronous, changing "eth0" into a simple bridge "br0" takes 25s. This can be converted to an asynchronous behavior. 2. ntpd should not be restarted, as it already monitors new and deleted interfaces every 5 minutes: ma 8 ntpd → -U. The scrips should be removed. 3. Several script do things for "--all" and "lo". They should use ucs_ignore_interface(). Now I'm down to 5s. (In reply to Florian Best from comment #4) > Also: when going 'back' to the network page and clicking on 'next' without > doing any change the network settings are applied again. This should not be > done. I get "No changes have been made.". As this is a UMC bug, file an new bug against UMC USS.n
r56682 has been reverted for now until the patch is applied.
Created attachment 6625 [details] Evaluate "BSD process accounting" (pacct) files ucr set repositroy/online/unmaintained=yes univention-install acct ... python 36532_net-pacct.py /var/log/account/pacct
Created attachment 6626 [details] Speedup network restart Subject: [PATCH 1/8] =?UTF-8?q?Bug=20#36532=20bind,s4c,listener,notifier,n?= Subject: [PATCH 2/8] Bug #36532 bind: Speed up network re-config Subject: [PATCH 3/8] Bug #36532 s4c,listener,notifier,net: Skip interfaces Subject: [PATCH 4/8] Bug #36532 net: Skip ntpd restart Subject: [PATCH 5/8] Bug #36532 net: Speed up UCR re-config Subject: [PATCH 6/8] Bug #36532 net: Speed up DNS config Subject: [PATCH 7/8] Bug #36532: Speed up if-*.d scripts Subject: [PATCH 8/8] Bug #36532: Restart listener/notifier asynchronously 8 and 2 are the most important ones and bring the most.
(In reply to Philipp Hahn from comment #8) > Created attachment 6626 [details] > Speedup network restart Cool! Philipp, would it be possible to remove unnecessary changes in the supplied patch? The adjusted copyright year in many files just obfuscates important changes.
(In reply to Alexander Kläser from comment #9) > (In reply to Philipp Hahn from comment #8) > > Created attachment 6626 [details] > > Speedup network restart > > Cool! I know if at least two other persons which would like this issue being resolved. Perhaps you should vote for this bug to make that liking explicit. > Philipp, would it be possible to remove unnecessary changes in the > supplied patch? The adjusted copyright year in many files just obfuscates > important changes. Please read comment #9 carefully: the first patch (1/8) of the series updates all the copyright in all the modules the following 7 patches modify, so that the following 7 patches are NOT polluted by those changes. This was explicitly requested by Stefan. FYI: The bug is now postponed as I spent too much time on that issue. The analysis is done, the patch is ready, but there currently is no ETA when it will be applied (again).
Is the change reverted? There still exists 2015-01-12-univention-network-manager.yaml
(In reply to Florian Best from comment #11) > Is the change reverted? There still exists > 2015-01-12-univention-network-manager.yaml Thanks: r57627 | Revert "Bug #36532 net: WIP speed up network config YAML"
r61226 | Bug #36532 test: Add bind9 reload test ucs-test for test "rndc reload" works. r61234 | Bug #36532: Restart listener/notifier asynchronously r61233 | Bug #36532: Speed up if-*.d scripts r61232 | Bug #36532 net: Speed up DNS config r61231 | Bug #36532 net: Speed up UCR re-config r61230 | Bug #36532 net: Skip ntpd restart r61229 | Bug #36532 s4c,listener,notifier,net: Skip interfaces r61228 | Bug #36532 bind: Speed up network re-config r61227 | Bug #36532 bind,s4c,listener,notifier,net: © 2015 Package: ucs-test Version: 5.0.148-12.1058.201506121718 Branch: ucs_4.0-0 Scope: errata4.0-2 Package: univention-network-manager Version: 6.0.1-1.107.201506121759 Branch: ucs_4.0-0 Scope: errata4.0-2 Package: univention-directory-notifier Version: 9.0.4-1.89.201506121802 Branch: ucs_4.0-0 Scope: errata4.0-2 Package: univention-bind Version: 9.0.6-1.207.201506121804 Branch: ucs_4.0-0 Scope: errata4.0-2 Package: univention-s4-connector Version: 9.0.17-1.558.201506121806 Branch: ucs_4.0-0 Scope: errata4.0-2 Package: univention-directory-listener Version: 9.0.3-1.268.201506121809 Branch: ucs_4.0-0 Scope: errata4.0-2 r61235 | Bug #36532 net: Faster network restart YAML 2015-06-03-univention-s4-connector.yaml 2015-06-12-univention-bind.yaml 2015-06-12-univention-directory-listener.yaml 2015-06-12-univention-directory-notifier.yaml 2015-06-12-univention-network-manager.yaml
<http://errata.univention.de/ucs/4.0/211.html>
r61349 | Bug #36532: Speed up network re-config r61350 | Bug #36532: Speed up network re-config Change package version numbers according to errata policy Package: univention-network-manager Version: 6.0.0-3.108.201506180826 Branch: ucs_4.0-0 Scope: errata4.0-2 Package: univention-directory-notifier Version: 9.0.3-2.90.201506180824 Branch: ucs_4.0-0 Scope: errata4.0-2 Package: univention-bind Version: 9.0.5-2.208.201506180830 Branch: ucs_4.0-0 Scope: errata4.0-2 r61351 | Bug #36532: Speed up network re-config YAML 2015-06-12-univention-bind.yaml 2015-06-12-univention-directory-notifier.yaml 2015-06-12-univention-network-manager.yaml
>+++ b/ucs-4.0-2/services/univention-bind/conffiles/etc/network/if-down.d/bind9 >+[ -e /etc/init.d/univention-bind9 ] || exit 0 >+invoke-rc.d univention-bind9 reload > +++ b/ucs-4.0-2/services/univention-bind/conffiles/etc/network/if-up.d/bind9 >+[ -x /etc/init.d/univention-bind9 ] || exit 0 >+invoke-rc.d univention-bind9 reload → There is not univention-bind9 but univention-bind!
(In reply to Florian Best from comment #16) ... > → There is not univention-bind9 but univention-bind! Fixed: r61666 | Bug #36532 BIND: Improve restart of bind9 on network reconfiguration Package: univention-bind Version: 9.0.5-3.209.201507021355 Branch: ucs_4.0-0 Scope: errata4.0-2 r61667 | Bug #36532 BIND: Improve restart of bind9 on network reconfiguration YAML 2015-06-12-univention-bind.yaml
OK: univention-s4-connector OK: univention-bind OK: univention-directory-listener OK: univention-directory-notifier REOPEN: univention-network-manager 1.) /etc/network/if-up.d/90_dns_update: 49: /etc/network/if-up.d/90_dns_update: /usr/sbin/univention-register-network-address: not found 2.) Traceback (most recent call last): File "/etc/network/if-up.d/12_univention_config_registry", line 88, in <module> ucr_update({'interfaces/restart/auto': 'false'}) TypeError: ucr_update() takes exactly 2 arguments (1 given) → missing first parameter configRegistry in both calls 3.) Fixing 2 leads to: Traceback (most recent call last): File "/etc/network/if-up.d/12_univention_config_registry", line 89, in <module> ucr_update(configRegistry, ucr_set) File "/usr/lib/pymodules/python2.7/univention/config_registry/frontend.py", line 189, in ucr_update changed = ucr.update(changes) File "/usr/lib/pymodules/python2.7/univention/config_registry/backend.py", line 279, in update registry[key] = value File "/usr/lib/pymodules/python2.7/univention/config_registry/backend.py", line 422, in __setitem__ value.decode('UTF-8') # only accept valid UTF-8 encoded bytes AttributeError: 'IPv4Address' object has no attribute 'decode' 4.) If 3.) failed (as it does in step 3) the UCR variable interfaces/restart/auto is changed to false.
Created attachment 6996 [details] Screenshot I had (somehow) a gateway=='' UCR variable set. After this i could not set up the network correctly anymore. A reboot helped. The rndc blocked some minutes. Shouldn't it be asynchronous?
(In reply to Florian Best from comment #18) > 1.) > /etc/network/if-up.d/90_dns_update: 49: /etc/network/if-up.d/90_dns_update: > /usr/sbin/univention-register-network-address: not found r61720 | Bug #36532 net: Fix removed but not purged package Added [ -x ] test > 2.) > → missing first parameter configRegistry in both calls r61716 | Bug #36532 net: Fix setting UCRVs > 3.) Fixing 2 leads to: > File "/usr/lib/pymodules/python2.7/univention/config_registry/backend.py", > line 422, in __setitem__ > value.decode('UTF-8') # only accept valid UTF-8 encoded bytes > AttributeError: 'IPv4Address' object has no attribute 'decode' r61716 | Bug #36532 net: Fix setting UCRVs > 4.) If 3.) failed (as it does in step 3) the UCR variable > interfaces/restart/auto is changed to false. r61716 | Bug #36532 net: Fix setting UCRVs Re-order UCR code to restore state last. (In reply to Florian Best from comment #19) > I had (somehow) a gateway=='' UCR variable set. After this i could not set > up the network correctly anymore. A reboot helped. This can happen if the DHCP client was not able to configure the gateway (which can happen, when configuring the IP address fails. The "RTNETLINK answers: File exists" message indicates, that the old address configuration was not flushed when taking down the interface. Debian converted /sbin/dhclient-script to use "iproute" instead of "ifconfig/route/...", which shows such suitable differences) > The rndc blocked some minutes. Shouldn't it be asynchronous? The screenshot show "lo" being down. I can reproduce it with "ifdown -a;rndc status". Not considered a bug worth fixing, as a downed "lo" break a lot more. I also removed last code setting UCRV interfaces/*/fallback/*. The only code left handling that is their removal by USS. ACKed by Stefan. Package: univention-network-manager Version: 6.0.0-5.110.201507031106 Branch: ucs_4.0-0 Scope: errata4.0-2 r61721 | Bug #36532 net: Fix removed but not purged package YAML 2015-06-12-univention-network-manager.yaml
OK: latest changes OK: YAML
<http://errata.univention.de/ucs/4.0/223.html>
<http://errata.univention.de/ucs/4.0/225.html>
<http://errata.univention.de/ucs/4.0/224.html>
2015-06-12-univention-network-manager.yaml has not been released. @Florian, is it already verified?
(In reply to Stefan Gohmann from comment #25) > 2015-06-12-univention-network-manager.yaml has not been released. > > @Florian, is it already verified? yes. best@univention.de 2015-07-03 12:12:37 CEST Status RESOLVED VERIFIED walkenhorst@univention.de 2015-07-03 14:06:17 CEST Status VERIFIED CLOSED gohmann@univention.de 2015-07-15 21:16:58 CEST Status CLOSED RESOLVED
<http://errata.univention.de/ucs/4.0/247.html>