Bug 232456 - release/tools/gce.conf: cannot query NTP because of the non resolved hostname
Summary: release/tools/gce.conf: cannot query NTP because of the non resolved hostname
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch, patch-ready
Depends on:
Blocks:
 
Reported: 2018-10-19 17:51 UTC by Lucas Kanashiro
Modified: 2018-11-29 01:03 UTC (History)
4 users (show)

See Also:


Attachments
Patch release/tools/gce.conf to allow NTP queries (356 bytes, patch)
2018-10-19 17:51 UTC, Lucas Kanashiro
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Kanashiro 2018-10-19 17:51:56 UTC
Created attachment 198376 [details]
Patch release/tools/gce.conf to allow NTP queries

After create a VM on GCE using a FreeBSD 12 image (projects/freebsd-org-cloud-dev/global/images/family/freebsd-12-0) for some reason I cannot query NTP because of non resolved hostname.

# ntpq -p
hostname nor servname provided, or not known

After adding '127.0.0.1 localhost' to /etc/hosts I am able to do the query.

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*metadata.google 71.79.79.71      2 u   42   64  377    0.530   65.006 121.795

I attached a patch that instead of overwrite the /etc/hosts with this content:

echo '169.254.169.254 metadata.google.internal metadata' > \
${DESTDIR}/etc/hosts

We simply append this line to the base /etc/hosts file.

One of the tests that the Google Cloud team runs against images is to query NTP this way that I described, so this is making some tests failures.
Comment 1 Lucas Kanashiro 2018-10-19 18:29:21 UTC
I can also reproduce this issue using FreeBSD 11 image available in GCE.
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-11-26 17:01:05 UTC
A commit references this bug:

Author: gjb
Date: Mon Nov 26 17:00:40 UTC 2018
New revision: 340983
URL: https://svnweb.freebsd.org/changeset/base/340983

Log:
  Fix NTP query on GCE due to unresolved hostname.

  PR:		232456
  Submitted by:	Lucas Kanashiro
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/release/tools/gce.conf
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-11-29 00:28:19 UTC
A commit references this bug:

Author: gjb
Date: Thu Nov 29 00:28:09 UTC 2018
New revision: 341167
URL: https://svnweb.freebsd.org/changeset/base/341167

Log:
  MFC r340983:
   Fix NTP query on GCE due to unresolved hostname.

  PR:		232456
  Submitted by:	Lucas Kanashiro
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/release/tools/gce.conf
_U  stable/12/
  stable/12/release/tools/gce.conf
Comment 4 Glen Barber freebsd_committer freebsd_triage 2018-11-29 01:03:13 UTC
Fixed, thank you!
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-11-29 01:03:49 UTC
A commit references this bug:

Author: gjb
Date: Thu Nov 29 01:02:52 UTC 2018
New revision: 341169
URL: https://svnweb.freebsd.org/changeset/base/341169

Log:
  MFS12 r341167:
   MFC r340983:
   Fix NTP query on GCE due to unresolved hostname.

  PR:		232456
  Submitted by:	Lucas Kanashiro
  Approved by:	re (delphij)
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  releng/12.0/
  releng/12.0/release/tools/gce.conf