HOSTNAME in nfsroot boot is FQDN

John G Heim jheim at math.wisc.edu
Thu Jun 8 18:30:05 CEST 2017


I posted about this problem approximately a year ago. I poked around in 
the source code a little but finally just made a workaround by adding a 
line to my class script:

echo "${HOSTNAME}" | sed s/\.math\.wisc\.edu//

So you end up with classes for both the fqdn and the hostname. The only 
problem with that seems to be that logs are created in 
/var/log/fai/<fqdn>/ instead of /var/logs/fai/<hostname>/.

I am a little surprised you're getting this in 5.3.6. I was running 
5.0.3 when I had the problem. I create a whole new FAI setup for 5.3.6 
and I don't have the problem any more. Are you using 5.3.6 in the 
nfsroot? I'm not sure how FAI installs FAI itself inside the nfsroot but 
you might be running an older version there. I am also installing ubuntu 
zesty instead of xenial but I don't see how that could matter.


On 06/08/2017 04:40 AM, Justin Cattle wrote:
> Hi,
> 
> 
> I've been testing migrating to fai 5 from 4.
> I'm currently using fai-5.3.6, on Ubuntu xenial, but with a Debian 
> stretch nfsroot [ due to lack of dracut support in ubuntu ].
> 
> When I build a host, the boot all works ok and the build process starts 
> fine.
> However, the hostname of the instance is somehow getting set to the FQDN.
> 
> It sounds like a small problem, but has a knock on effect on some of our 
> custom class assignment scripts.
> 
> I know that dhcp is sending the correct host-name.
> 
> 
> It looks like FAI set's the HOSTNAME variable from this script passed 
> from dhclient:
> 
>     root      1531  0.0  0.0  21484  1076 ?        Ss   10:21   0:00
>     dhclient -lf /dev/null -cf /usr/share/fai/dhclient-fai.conf -sf
>     /usr/share/fai/dhclient-fai-script eth0
> 
> 
> Am I right in thinking that?
> 
> Any ideas on how I can fix or debug this so HOSTNAME is set to the 
> host-name requested from DHCP?
> 
> It's not even obvious to me where the dhcp config for fai that calls 
> that script is set.
> 
> 
> Any help or info is greatly appreciated.
> Thanks!
> 
> 
> 
> Cheers,
> Just
> 
> Notice:  This email is confidential and may contain copyright material 
> of members of the Ocado Group. Opinions and views expressed in this 
> message may not necessarily reflect the opinions and views of the 
> members of the Ocado Group.
> 
> If you are not the intended recipient, please notify us immediately and 
> delete all copies of this message. Please note that it is your 
> responsibility to scan this message for viruses.
> 
> Fetch and Sizzle are trading names of Speciality Stores Limited and 
> Fabled is a trading name of Marie Claire Beauty Limited, both members of 
> the Ocado Group.
> 
> References to the “Ocado Group” are to Ocado Group plc (registered in 
> England and Wales with number 7098618) and its subsidiary undertakings 
> (as that expression is defined in the Companies Act 2006) from time to 
> time.  The registered office of Ocado Group plc is Buildings One & Two, 
> Trident Place, Mosquito Way, Hatfield, Hertfordshire, AL10 9UL.
> 


More information about the linux-fai mailing list