From 10aed019838b956868f732b972f4984f132a0d77 Mon Sep 17 00:00:00 2001 From: Dexter Morgan Date: Thu, 26 Jan 2012 11:50:49 +0000 Subject: make drakclock systemd compatible --- perl-install/NEWS | 2 ++ perl-install/standalone/drakclock | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index b575fb3c2..602d1896a 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,5 @@ +- make drakclock systemd compatible + Version 13.79 - 25 January 2012 - silent failure to extract gz modules (for rescue) diff --git a/perl-install/standalone/drakclock b/perl-install/standalone/drakclock index ea39f5305..7b13dd764 100755 --- a/perl-install/standalone/drakclock +++ b/perl-install/standalone/drakclock @@ -25,6 +25,7 @@ $ugtk2::wm_icon = "/usr/share/mcc/themes/default/time-mdk.png"; my $ntpfile = '/etc/ntp.conf'; my $ntpdlock = '/var/lock/subsys/ntpd'; +my $ntpdsystemdlock = '/sys/fs/cgroup/systemd/system/ntpd.service'; my $my_win = ugtk2->new(N("Date, Clock & Time Zone Settings")); @@ -132,6 +133,10 @@ $my_win->{window}->add(gtknew('VBox', border_width => $::isEmbedded ? 0 : 5, chi system(qw(service ntpd stop)); system(qw(/sbin/chkconfig --level 35 ntpd off)); } + elsif (-e $ntpdsystemdlock) { + system(qw(systemctl stop ntpd.service)); + system(qw(systemctl disable ntpd.service)); + } } if ($need_date) { my ($year, $month, $day) = $calendar->get_date; @@ -163,7 +168,7 @@ $time_box->set_direction('ltr'); my $servers = get_server(); $combo_ntpserver->set_popdown_strings(@$servers); -if (-e $ntpfile && -e $ntpdlock) { +if (-e $ntpfile && ( -e $ntpdsystemdlock || -e $ntpdlock)) { $ntp = timezone::ntp_server(); $ntp and ntp_widget_state(1); my $fullntp = $ntp; -- cgit v1.2.1