From 778cd73bb622eecd588445e3ef98a80af0148470 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Thu, 2 Nov 2023 13:24:04 +0000 Subject: [PATCH] ts-host-install: Restart ntp service MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise, the change to the config file isn't taken into account until the next reboot. Signed-off-by: Anthony PERARD Acked-by: Roger Pau Monné --- ts-host-install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ts-host-install b/ts-host-install index 0027748..43ed928 100755 --- a/ts-host-install +++ b/ts-host-install @@ -152,10 +152,12 @@ END my $ntpserver = get_target_property($ho, 'NtpServer'); if ($ntpserver) { my $ntpconf_path; + my $ntp_service; if ($ho->{Suite} =~ m/lenny|squeeze|wheezy|jessie|stretch|buster/) { $ntpconf_path = '/etc/ntp.conf'; } else { $ntpconf_path = '/etc/ntpsec/ntp.conf'; + $ntp_service = 'ntpsec'; } target_editfile_root($ho, $ntpconf_path, sub { my $done= 0; @@ -173,6 +175,9 @@ END } $done or die; }); + if ($ntp_service) { + target_cmd_root($ho, "service $ntp_service restart"); + } } host_install_postboot_complete($ho); -- 2.39.5