[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 9/9] NTP servers: Work around Debian's failure to honour preseed



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@xxxxxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.