All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [OSSTEST PATCH 9/9] NTP servers: Work around Debian's failure to honour preseed
Date: Tue, 17 Feb 2015 17:50:31 +0000	[thread overview]
Message-ID: <1424195431-1493-10-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1424195431-1493-1-git-send-email-ian.jackson@eu.citrix.com>

Setting clock-setup/ntp-server is not sufficient: it only takes effect
in the installer (!)

I have reported this as Debian #778564.  In the meantime we should
work around it for current releases (including jessie, which is
frozen).

For later releases, the new ntp.conf editing code arranges to bomb out
if we have an NTP server configured and find it hasn't been honoured
during the install.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ts-host-install |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/ts-host-install b/ts-host-install
index ae1d228..9656079 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -119,6 +119,26 @@ END
 
     target_install_packages($ho, qw(ed));
 
+    my $ntpserver = get_target_property($ho, 'NtpServer');
+    if ($ntpserver) {
+	target_editfile_root($ho, '/etc/ntp.conf', sub {
+	    my $done= 0;
+	    while (<EI>) {
+		if (m/^server\s/) {
+		    if ($ho->{Suite} =~ m/lenny|squeeze|wheezy|jessie/) {
+			$_= $done ? "" : "server $ntpserver\n";
+		    } else {
+			m/^server \Q$ntpserver\E\s/ or
+			    die "NTP server not honoured, Debian #778564 ";
+		    }
+		    $done= 1;
+		}
+		print EO or die $!;
+	    }
+	    $done or die;
+	});
+    }
+
     target_cmd_root($ho, "update-rc.d osstest-confirm-booted start 99 2 .");
 
     logm('OK: install completed');
-- 
1.7.10.4

      parent reply	other threads:[~2015-02-17 18:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-17 17:50 [OSSTEST PATCH 0/9] Fix NTP unreliability, and other fixes Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 1/9] cs-adjust-flight: Add missing `use Data::Dumper' Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 2/9] sg-report-job-history: Increase default history depth to 500 Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 3/9] config: Tiny fixes Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 4/9] TestSupport: Provide get_target_property Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 5/9] Debian.pm: Pass $ho/$gho to preseed_base Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 6/9] Debian.pm: Slightly refactor preseed_base Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 7/9] NTP servers: Introduce new NtpServer host property Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 8/9] NTP servers: Use " Ian Jackson
2015-02-17 17:50 ` Ian Jackson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424195431-1493-10-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.