]> xenbits.xensource.com Git - osstest.git/commitdiff
ts-host-install: Restart ntp service
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 2 Nov 2023 13:24:04 +0000 (13:24 +0000)
committerAnthony PERARD <anthony.perard@citrix.com>
Thu, 28 Mar 2024 16:51:52 +0000 (16:51 +0000)
Otherwise, the change to the config file isn't taken into account
until the next reboot.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
ts-host-install

index 002774855fcd5003d4962023eb69347d8f7140e8..43ed9285dbfced1469e579817e7460f3719096dd 100755 (executable)
@@ -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);