<div dir="ltr">Aha - it is dracut - I've just found this!<div><br></div><div><a href="https://bugzilla.redhat.com/attachment.cgi?id=535417&action=diff">https://bugzilla.redhat.com/attachment.cgi?id=535417&action=diff</a><br></div><div><br></div><div>Disappointing - hostnames with with a "." aren't even valid are they ?</div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div><br></div>Cheers,<div>Just</div></div></div>
<br><div class="gmail_quote">On 8 June 2017 at 21:43, Justin Cattle <span dir="ltr"><<a href="mailto:j@ocado.com" target="_blank">j@ocado.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for the input John.<div>Glad to here it's not just me :)<br></div><div><br></div><div><br></div><div>I could implement some workarounds in the various scripts, that's true.</div><div><br></div><div><br></div><div>I've been doing some digging, and although I don't have the real answer yet, I don't believe it's a FAI problem as such, it's something about the NFSROOT OS.  In my case, debian stretch.</div><div><br></div><div>This script does get the correct info from DHCP:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>/usr/share/fai/dhclient-fai-<wbr>script</div></blockquote><div><br></div><div>If you change the content to log to a file:</div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><br></div><div>perl /usr/lib/fai/dhclient-perl >/tmp/foo 2>&1</div></blockquote></div><div><br></div><div>The file contains the correct HOSTNAME value.</div><div><br></div><div><br></div><div>Likewise, if you change the perl script itself:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>--- dhclient-perl<span class="m_-3213631424371584424gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>2017-06-08 14:06:00.857442761 +0100</div></div><div><div>+++ usr/lib/fai/dhclient-perl<span class="m_-3213631424371584424gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>2017-06-08 16:28:03.015219588 +0100</div></div><div><div>@@ -29,7 +29,7 @@</div></div><div><div> # map dhcp names to bootp names</div></div><div><div> %names = qw/</div></div><div><div>   ip_address              IPADDR</div></div><div><div>-  host_name               HOSTNAME</div></div><div><div>+  host_name               FAI_HOSTNAME</div></div></blockquote><div><br></div><div>The variable FAI_HOSTNAME appears with the correct short name you would expect to find in HOSTNAME.</div><div><br></div><div>This makes me to think that something else is setting the HOSTNAME varialbe in the environment, and that the FAI scripts don't then override that.</div><div><br></div><div>That part might be handled by the perl script, but my perl is non-existent, and I don't really know if that's the case.</div><div><br></div><div><br></div><div>If that is all true, the question is what is setting the HOSTNAME variable.  I've tried disabling /etc/init.d/hostname.sh, and lib/systemd/system/systemd-<wbr>hostnamed.service, but it doesn't seem to help.  Maybe something else in systemd, or even dracut.  But I can't find it...</div><div><br></div><div>In fact, just been looking some more, and the hostname is set before /usr/sbin/fai runs , /proc/sys/kernel/hostname is set , so maybe it is dracut?</div><div><br></div><div><br></div><div>I'd really like to get to the bottom of this before I implement workarounds.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-3213631424371584424gmail_signature" data-smartmail="gmail_signature"><div><br></div>Cheers,<div>Just</div></div></div><div><div class="h5">
<br><div class="gmail_quote">On 8 June 2017 at 17:30, John G Heim <span dir="ltr"><<a href="mailto:jheim@math.wisc.edu" target="_blank">jheim@math.wisc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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:<br>
<br>
echo "${HOSTNAME}" | sed s/\.math\.wisc\.edu//<br>
<br>
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>/.<br>
<br>
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.<div><div class="m_-3213631424371584424h5"><br>
<br>
<br>
On 06/08/2017 04:40 AM, Justin Cattle wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-3213631424371584424h5">
Hi,<br>
<br>
<br>
I've been testing migrating to fai 5 from 4.<br>
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 ].<br>
<br>
When I build a host, the boot all works ok and the build process starts fine.<br>
However, the hostname of the instance is somehow getting set to the FQDN.<br>
<br>
It sounds like a small problem, but has a knock on effect on some of our custom class assignment scripts.<br>
<br>
I know that dhcp is sending the correct host-name.<br>
<br>
<br>
It looks like FAI set's the HOSTNAME variable from this script passed from dhclient:<br>
<br>
    root      1531  0.0  0.0  21484  1076 ?        Ss   10:21   0:00<br>
    dhclient -lf /dev/null -cf /usr/share/fai/<a href="http://dhclient-fai.co" target="_blank">dhclient-fai.co</a><wbr>nf -sf<br>
    /usr/share/fai/dhclient-fai-sc<wbr>ript eth0<br>
<br>
<br>
Am I right in thinking that?<br>
<br>
Any ideas on how I can fix or debug this so HOSTNAME is set to the host-name requested from DHCP?<br>
<br>
It's not even obvious to me where the dhcp config for fai that calls that script is set.<br>
<br>
<br>
Any help or info is greatly appreciated.<br>
Thanks!<br>
<br>
<br>
<br>
Cheers,<br>
Just<br>
<br></div></div>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
</blockquote>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>

<br>
<p style="font-family:Arial,Helvetica,sans-serif;font-size:1.3em;margin:0px;background-color:rgb(255,255,255)"><font color="#aeaaaa" face="Calibri, sans-serif"><span style="font-size:14.6667px">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. </span></font></p><p style="font-family:Arial,Helvetica,sans-serif;font-size:1.3em;margin:0px;background-color:rgb(255,255,255)"><font color="#aeaaaa" face="Calibri, sans-serif"><span style="font-size:14.6667px"> </span></font></p><p style="font-family:Arial,Helvetica,sans-serif;font-size:1.3em;margin:0px;background-color:rgb(255,255,255)"><font color="#aeaaaa" face="Calibri, sans-serif"><span style="font-size:14.6667px">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. </span></font></p><p style="font-family:Arial,Helvetica,sans-serif;font-size:1.3em;margin:0px;background-color:rgb(255,255,255)"><font color="#aeaaaa" face="Calibri, sans-serif"><span style="font-size:14.6667px"> </span></font></p><p style="font-family:Arial,Helvetica,sans-serif;font-size:1.3em;margin:0px;background-color:rgb(255,255,255)"><font color="#aeaaaa" face="Calibri, sans-serif"><span style="font-size:14.6667px">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.</span></font></p><p style="font-family:Arial,Helvetica,sans-serif;font-size:1.3em;margin:0px;background-color:rgb(255,255,255)"><font color="#aeaaaa" face="Calibri, sans-serif"><span style="font-size:14.6667px"> </span></font></p><p style="margin:0px;background-color:rgb(255,255,255)"><font color="#aeaaaa" face="Calibri, sans-serif" style="font-family:Arial,Helvetica,sans-serif;font-size:1.3em"><span style="font-size:14.6667px">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 </span></font><font color="#aeaaaa" face="calibri, sans-serif"><span style="font-size:14.6667px">Buildings One & Two, Trident Place, Mosquito Way, Hatfield, Hertfordshire, AL10 9UL</span></font><span style="font-family:Arial,Helvetica,sans-serif;font-size:14.6667px;color:rgb(174,170,170)"><font face="Calibri, sans-serif">.</font></span></p>