summary refs log tree commit diff
path: root/gnu/services
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2016-10-23 14:16:39 -0400
committerMark H Weaver <mhw@netris.org>2016-10-23 14:16:39 -0400
commitca0635b4ba1af6f4ef1f54cb13fe6cedd8c5aff3 (patch)
tree1b3e014c4e0398ecb63d1b88ee06b09d0c0c5a56 /gnu/services
parentf08add0c5a3f1f7200b0a00e17ed880692d2244b (diff)
parent903276d066ab9733c253d2a15b7ae135ef2ef836 (diff)
downloadguix-ca0635b4ba1af6f4ef1f54cb13fe6cedd8c5aff3.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/networking.scm23
1 files changed, 17 insertions, 6 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 7495179f8e..df609da0de 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -265,11 +265,13 @@ Protocol (DHCP) client, on all the non-loopback network interfaces."
   ntp-configuration?
   (ntp      ntp-configuration-ntp
             (default ntp))
-  (servers  ntp-configuration-servers))
+  (servers  ntp-configuration-servers)
+  (allow-large-adjustment? ntp-allow-large-adjustment?
+                           (default #f)))
 
 (define ntp-shepherd-service
   (match-lambda
-    (($ <ntp-configuration> ntp servers)
+    (($ <ntp-configuration> ntp servers allow-large-adjustment?)
      (let ()
        ;; TODO: Add authentication support.
        (define config
@@ -296,7 +298,10 @@ restrict -6 ::1\n"))
               (requirement '(user-processes networking))
               (start #~(make-forkexec-constructor
                         (list (string-append #$ntp "/bin/ntpd") "-n"
-                              "-c" #$ntpd.conf "-u" "ntpd")))
+                              "-c" #$ntpd.conf "-u" "ntpd"
+                              #$@(if allow-large-adjustment?
+                                     '("-g")
+                                     '()))))
               (stop #~(make-kill-destructor))))))))
 
 (define %ntp-accounts
@@ -331,12 +336,18 @@ restrict -6 ::1\n"))
                                           ntp-service-activation)))))
 
 (define* (ntp-service #:key (ntp ntp)
-                      (servers %ntp-servers))
+                      (servers %ntp-servers)
+                      allow-large-adjustment?)
   "Return a service that runs the daemon from @var{ntp}, the
 @uref{http://www.ntp.org, Network Time Protocol package}.  The daemon will
-keep the system clock synchronized with that of @var{servers}."
+keep the system clock synchronized with that of @var{servers}.
+@var{allow-large-adjustment?} determines whether @command{ntpd} is allowed to
+make an initial adjustment of more than 1,000 seconds."
   (service ntp-service-type
-           (ntp-configuration (ntp ntp) (servers servers))))
+           (ntp-configuration (ntp ntp)
+                              (servers servers)
+                              (allow-large-adjustment?
+                               allow-large-adjustment?))))
 
 
 ;;;