Stop also ntpd

For cases where there is already running ntpd instead of chronyd,
we have to also stop ntpd to not block ntpdate.

Change-Id: Ic075bc02665ae6c572aa72c13b09ed097f0fbdee
Resolves: rhbz#1171588
This commit is contained in:
Martin Mágr
2015-11-03 16:42:02 +01:00
parent 81a934b86f
commit 59c5ca302e

View File

@@ -65,7 +65,15 @@ file { 'chrony_conf':
}
exec { 'stop-chronyd':
command => '/usr/bin/systemctl stop chronyd.service',
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => 'systemctl stop chronyd.service',
onlyif => 'systemctl status chronyd.service'
}
# for cases where ntpd is running instead of default chronyd
service { 'ntpd':
ensure => stopped,
enable => false,
}
exec { 'ntpdate':
@@ -85,5 +93,6 @@ Package['chrony'] ->
Package['ntpdate'] ->
File['chrony_conf'] ->
Exec['stop-chronyd'] ->
Service['ntpd'] ->
Exec['ntpdate'] ->
Service['chronyd']