Univention Bugzilla – Bug 30397
interfaces/primary should place the interface IP first in /etc/hosts
Last modified: 2018-11-28 12:10:41 CET
Setting the UCR interfaces/primary to something different than eth0 does not change the order of IP adresses in /etc/hosts.
For example: If you bind Samba to a specific interface/IP you will most likely want this IP to be used when connecting to $hostname.$domainname.
This is a potential problem for all installations with more than one interface
-> ucr get interfaces/ens3/address
-> ucr get interfaces/ens6/address
-> ucr get interfaces/primary
With this setup (interfaces/primary has been set automatically during the installation) i get the following /etc/hosts
-> more /etc/hosts
192.168.152.32 slave.test.local slave
169.254.93.50 slave.test.local slave
Now the system resolve its own ip to "169.254.93.50", which is not used by samba
-> samba-tool drs showrepl
Failed to connect host 169.254.93.50 on port 135 - NT_STATUS_CONNECTION_REFUSED
Failed to connect host 169.254.93.50 (slave.test.local) on port 135 - NT_STATUS_CONNECTION_REFUSED.
Failed to connect host 169.254.93.50 on port 49152 - NT_STATUS_CONNECTION_REFUSED
Failed to connect host 169.254.93.50 (slave.test.local) on port 49152 - NT_STATUS_CONNECTION_REFUSED.
DSA Options: 0x00000001
DSA object GUID: 9b98fb31-f2d8-4168-acef-62384b7a02db
This breaks the update tests.
Set host entry for this interface to a dummy value
ucr set interfaces/ens6/hosts="dummy.name dummy"
once this is fixed, remove the workaround in test/scenarios/install-testing/samba-env.cfg
117250f3654829666ba8b171468fc8b494952217 - univention-base-files
ensure that interfaces/primary is first entry in /etc/hosts
also removed workaround in samba install test, acb95c9433eb93615fbaef4c2eeaa31c77dfb449
I think primary_entry also needs to be a list, because the primary interface may have an IPv4 and a IPv6 address assigned simultaneously.
(In reply to Arvid Requate from comment #5)
> I think primary_entry also needs to be a list, because the primary interface
> may have an IPv4 and a IPv6 address assigned simultaneously.
ok, fixed, print both, ipv4 and ipv6, primary entries first