From dd7c30bd6b30a6ac3cf23b5460e8337f147b13a2 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 4 Jan 2026 15:30:25 +0000 Subject: drakclock: fix config file read/write for chrony and ntpsec (mga#34664) drakclock only supports selecting a server pool, not individual servers, so use the "pool" directive instead if the "server" directive. Rename the subroutines in timezone.pm for clarity. ntpsec overrides /etc/ntp.conf with settings found in /etc/ntp.d/, so we need to read/write /etc/ntp.d/use-pool. Both chrony and ntpsec support the iburst option, so we can write that unconditionally. --- perl-install/standalone/drakclock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/drakclock b/perl-install/standalone/drakclock index ca8c69477..310701dbe 100755 --- a/perl-install/standalone/drakclock +++ b/perl-install/standalone/drakclock @@ -23,8 +23,8 @@ my $its_reset = 0; $ugtk3::wm_icon = "/usr/share/mcc/themes/default/time-mdk.png"; -my $ntpd = $timezone::ntp . 'd'; -my $ntpfile = '/etc/' . $timezone::ntp . '.conf'; +my $ntpd = $timezone::ntpd; +my $ntpfile = $timezone::ntp_conf; my $my_win = ugtk3->new(N("Date, Clock & Time Zone Settings")); @@ -117,7 +117,7 @@ $my_win->{window}->add( err_dialog(N("Error"), N("Please enter a valid NTP server address.")); return; } - timezone::set_ntp_server($choosed_serv); + timezone::set_ntp_pool($choosed_serv); system('systemctl', 'enable', "$ntpd.service"); system('systemctl', 'stop', "$ntpd.service"); #verify that we have a valid hostname (thx sam) @@ -180,7 +180,7 @@ $time_box->set_direction('ltr'); my $servers = get_server(); $combo_ntpserver->set_popdown_strings(@$servers); if (-e $ntpfile && is_ntp_daemon_running()) { - $ntp = timezone::ntp_server(); + $ntp = timezone::ntp_pool(); $ntp and ntp_widget_state(1); my $fullntp = $ntp; my $short_ntp = $ntp; -- cgit v1.2.1