Bug 30397 - interfaces/primary should place the interface IP first in /etc/hosts
interfaces/primary should place the interface IP first in /etc/hosts
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Network
UCS 4.2
Other Linux
: P3 minor (vote)
: UCS 4.3-2-errata
Assigned To: Felix Botner
Arvid Requate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-12 09:24 CET by Janis Meybohm
Modified: 2018-11-28 12:10 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.171
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional): Workaround is available
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2013-02-12 09:24:36 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.
Comment 1 Felix Botner univentionstaff 2018-08-24 13:41:01 CEST
This is a potential problem for all installations with more than one interface

-> ucr get interfaces/ens3/address 
192.168.152.32
-> ucr get interfaces/ens6/address 
169.254.93.50
-> ucr get interfaces/primary 
ens3

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.
Default-First-Site-Name\SLAVE
DSA Options: 0x00000001
DSA object GUID: 9b98fb31-f2d8-4168-acef-62384b7a02db



This breaks the update tests.
Comment 2 Felix Botner univentionstaff 2018-08-24 14:23:16 CEST
Workaround:

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
Comment 3 Felix Botner univentionstaff 2018-11-22 15:36:23 CET
117250f3654829666ba8b171468fc8b494952217 - univention-base-files

ensure that interfaces/primary is first entry in /etc/hosts
Comment 4 Felix Botner univentionstaff 2018-11-22 15:38:29 CET
also removed workaround in samba install test, acb95c9433eb93615fbaef4c2eeaa31c77dfb449
Comment 5 Arvid Requate univentionstaff 2018-11-22 18:15:13 CET
I think primary_entry also needs to be a list, because the primary interface may have an IPv4 and a IPv6 address assigned simultaneously.
Comment 6 Felix Botner univentionstaff 2018-11-22 18:37:00 CET
(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
Comment 7 Arvid Requate univentionstaff 2018-11-22 19:37:51 CET
Ok.
Comment 8 Arvid Requate univentionstaff 2018-11-28 12:10:41 CET
<http://errata.software-univention.de/ucs/4.3/338.html>