Univention Bugzilla – Bug 30441
boot of a ucc client takes a very long time (5min) if the ucs master is not reachable
Last modified: 2013-04-24 17:26:26 CEST
Setup: UCS Master and UCS Slave, DHCP DNS Policy with both hosts as nameservers and a UCC Client with ldap/server/addition set to the slave. Booting the client if the master is down takes about 5 minutes. The Problem is the self.lo.start_tls_s call on an unreachable ldapserver in uldap.py in the initrd (e.g., /usr/sbin/univention-ucc-boot-option --read). uldap.py:access.__open calls self.lo.start_tls_s and this takes forever, if it is called in the initrd. If the system has booted correctly self.lo.start_tls_s takes about 3 seconds which is tolerable. initrd: -> chroot /root /usr/sbin/univention-ucc-boot-option --read real 1m20.590s user 0m0.200s sys 0m0.56s booted system: -> time usr/sbin/univention-ucc-boot-option --read real 0m4.227s user 0m0.348s sys 0m0.272s With strace is see. -> strace ... connect(3, {sa_family=AF_INET, sin_port=htons(7389), sin_addr=inet_addr("10.200.7.120")}, 16 (10.200.7.120 is the deactivated ucs master) For testing purposes, I added a ldap timeout in uldap.py:access.__open self.lo.set_option(ldap.OPT_NETWORK_TIMEOUT, 3) before self.lo.start_tls_s() and it took less time. But the question is, why it takes so much longer when started in the initrd.
The increased delay seems to originate from two sources. 1) dnsmasq is not running in the initrd. DNS requests are first executed against the non-running master, which increase the runtime for about 15 seconds. 2) there is a difference in how the connect()'s are handling the request in the initrd and a completely booted client: in the initrd the connect fails with a timeout -1 ETIMEDOUT (Connection timed out); when the client is booted the connect fails almost immediately with a EHOSTUNREACH (No route to host).
(In reply to comment #1) > 1) dnsmasq is not running in the initrd. DNS requests are first executed > against the non-running master, which increase the runtime for about 15 > seconds. In UCS we often use the option "options timeout:2" in /etc/resolv.conf.
options timeout:2 is already written to resolv.conf by the initscript ucc immediately after a ip address has been obtained.
The startup delay has been greatly reduced by starting the loopback interface in the initramfs script ucc. Start time to login greeter is now around 1:20 minutes down from 4:30 minutes. univention-ucc-initramfs 1.0.19-3.73.201304091246 2013-04-09-univention-ucc-initramfs.yaml The remaining delay is due to 3 seperate scripts who contact the ldap-server and each have to wait for a timeout. As this is beyond the errata scope, bug 31001 has been created.
OK - ucc-errata boot time without running primary dns server reduced to 1.5 min OK - YAML
http://errata.univention.de/ucc/1.0/7.html