[sles-beta] SLES12 x86_64 Beta3 autoyast issue /etc/hosts no hostname entry

urs.frey at post.ch urs.frey at post.ch
Wed Mar 26 07:41:15 MDT 2014


Hello Marius

Thank you very much!
I inserted as you told in my autoinst.xml
    <dns>
      <dhcp_hostname config:type="boolean">false</dhcp_hostname>
      <dhcp_resolv config:type="boolean">false</dhcp_resolv>
      <write_hostname config:type="boolean">true</write_hostname>
      <domain>pnet.ch</domain>
      <hostname>h063uz</hostname>
      <nameservers config:type="list">
        <nameserver>10.1.121.11</nameserver>
        <nameserver>10.2.121.11</nameserver>
      </nameservers>
      <searchlist config:type="list">
        <search>pnet.ch</search>
        <search>post.ch</search>
      </searchlist>
    </dns>

But the result is not exactly what I expect. Hostname gets written, but the TCP/IP Address is not the correct one
#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
127.0.0.2       h063uz.pnet.ch h063uz

I expect to have the configured IP address in my /etc/hosts, just the way it gets written when I configure manually, using yast
10.226.154.19 h063uz.pnet.ch h063uz

#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
10.226.154.19   h063uz.pnet.ch h063uz

I also tried to extend the autoinst.xml code and to define host within autoinst.xml, but I never get the correct result

  <networking>
    <dns>
      <dhcp_hostname config:type="boolean">false</dhcp_hostname>
      <dhcp_resolv config:type="boolean">false</dhcp_resolv>
      <write_hostname config:type="boolean">true</write_hostname>
      <domain>pnet.ch</domain>
      <hostname>h063uz</hostname>
      <nameservers config:type="list">
        <nameserver>10.1.121.11</nameserver>
        <nameserver>10.2.121.11</nameserver>
      </nameservers>
      <searchlist config:type="list">
        <search>pnet.ch</search>
        <search>post.ch</search>
      </searchlist>
    </dns>
    <host>
      <hosts config:type="list">
         <hosts_entry>
           <host_address>127.0.0.1</host_address>
           <names config:type="list">
              <name>localhost</name>
           </names>
         </hosts_entry>
         <hosts_entry>
           <host_address>10.226.154.19</host_address>
           <names config:type="list">
              <name>h063uz.pnet.ch h063uz</name>
           </names>
       </hosts>
    </host>

So from my point of view, there is something wrong with autoyast

Best regards

Urs Frey                                              
Post CH AG
Informationstechnologie
IT Betrieb 
Webergutstrasse 12 
3030 Bern (Zollikofen) 
Telefon : ++41 (0)58 338 58 70 
FAX     : ++41 (0)58 667 30 07 
E-Mail:   urs.frey at post.ch

-----Ursprüngliche Nachricht-----
Von: sles-beta-bounces at lists.suse.com [mailto:sles-beta-bounces at lists.suse.com] Im Auftrag von Marius Tomaschewski
Gesendet: Wednesday, March 26, 2014 8:53 AM
An: sles-beta at lists.suse.com
Betreff: Re: [sles-beta] SLES12 x86_64 Beta3 autoyast issue /etc/hosts no hostname entry

Am 25.03.2014 17:02, schrieb urs.frey at post.ch:
> Hi
Hi!

BTW: You don't need to add me to Cc -- I'm on the list too :-)

I don't have much clue about all the yast2 stuff -- I'm one from
the backend (wicked + sysconfig) side.... but let's try:

> In my autoinst.xml I do have DNS and hostname definition included.
> But on the installed server in /etc/hosts there gets only localhost defined,
 > the entry of the own IP address and hostname is missing
>
>    <networking>
>      <dns>
>        <dhcp_hostname config:type="boolean">false</dhcp_hostname>

AFAIS, this causes to set DHCLIENT_SET_HOSTNAME="no"

>        <dhcp_resolv config:type="boolean">false</dhcp_resolv>

A "grep -rl dhcp_resolv $(rpm -ql autoyast2-installation)" does not show 
any match.

>        <domain>pnet.ch</domain>
>        <hostname>h063uz</hostname>

-> AFAIS, it causes to write $hostname.$domain into /etc/HOSTNAME

>        <nameservers config:type="list">
>          <nameserver>10.1.121.11</nameserver>
>          <nameserver>10.2.121.11</nameserver>
>        </nameservers>

-> NETCONFIG_DNS_STATIC_SERVERS

>        <searchlist config:type="list">
>          <search>pnet.ch</search>
>          <search>post.ch</search>
>        </searchlist>

-> NETCONFIG_DNS_STATIC_SEARCHLIST

>      </dns>
[...]

> /etc/hosts file I get
>
> h063uz:~ # cat /etc/hosts
[...]
> h063uz:~ #

IMO it looks fine with this profile.

> Do I look at the wrong end? I mean in all our /etc/hosts files there is an entry
> When I do install the very same server manually and configure the network in yast2
 > I do end up with an /etc/hosts entry
>
> 127.0.0.1       localhost
> 10.226.154.19   h063uz.pnet.ch h063uz


This is caused by the yast2 only setting WRITE_HOSTNAME_TO_HOSTS=yes [it 
is never used by anything else] -- default is "no" and it may be
set by some per-product defaults.

Note: it disables dns lookups for the own hostname & ip completely
and may break things.

I'd say, you profile is missing this statement in <dns>:

    <write_hostname config:type="boolean">true</write_hostname>

Gruesse / Regards,
  Marius Tomaschewski <mt at suse.de>, <mt at suse.com>
-- 
  SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg),
  GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer,
  Maxfeldstraße 5, 90409 Nürnberg, Germany
_______________________________________________
sles-beta mailing list
sles-beta at lists.suse.com
http://lists.suse.com/mailman/listinfo/sles-beta


More information about the sles-beta mailing list