]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
stop/restart ntpd if present to change server time (fix bug #5599)
authorguido <guido@bruo.org>
Fri, 2 May 2014 17:25:43 +0000 (13:25 -0400)
committerguido <guido@bruo.org>
Fri, 2 May 2014 17:25:43 +0000 (13:25 -0400)
lib/leap_cli/remote/tasks.rb

index 249c1076fb1b625c009c79ccccba900c182393bf..0a12a95d45c4cc89e071dac7aee2d90c7f576a26 100644 (file)
@@ -38,12 +38,12 @@ task :install_prerequisites, :max_hosts => MAX_HOSTS do
     run "apt-get update"
   end
   leap.log :updating, "server time" do
-    run "test -f /etc/init.d/ntp || #{apt_get} install ntp && /etc/init.d/ntp stop"
+    run "( test -f /etc/init.d/ntp && /etc/init.d/ntp stop ) || true"
     run "test -f /usr/sbin/ntpdate || #{apt_get} install ntpdate"
     leap.log :running, "ntpdate..." do
       run "test -f /usr/sbin/ntpdate && ntpdate 0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org"
     end
-    run "test -f /etc/init.d/ntp && /etc/init.d/ntp start"
+    run "( test -f /etc/init.d/ntp && /etc/init.d/ntp start ) || true"
   end
   leap.log :installing, "required packages" do
     run "#{apt_get} install #{leap.required_packages}"