Patchwork [1/1] services: ntpd: Make large clock adjustments if necessary.

login
register
mail settings
Submitter Leo Famulari
Date Oct. 12, 2016, 11:21 p.m.
Message ID <f1eb5f6a5c5b2609c46881095ae5faf0c2453eba.1476314459.git.leo@famulari.name>
Download mbox | patch
Permalink /patch/16452/
State New
Headers show

Comments

Leo Famulari - Oct. 12, 2016, 11:21 p.m.
If the system clock is more than 1000 seconds off, ntpd will exit without
adjusting the clock.

Reported by reepca on #guix.

* gnu/services/networking.scm (ntp-shepherd-service): Pass '-g' when
starting the NTP daemon.
---
 gnu/services/networking.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
John Darrington - Oct. 13, 2016, 5:06 a.m.
I think that this should be a configuration item in the service, so that the
user can decide whether to have it or not.  I don't think we should force it
on the user.   Some applications break if the clock makes large jumps.

The ntpd authors decided that the default behaviour is not to make large jumps
so I think we should respect that unless there is a good reason to do otherwise.
So I think this should be configurable in /etc/config.scm and the default should
be not to use -g

J'

On Wed, Oct 12, 2016 at 07:21:07PM -0400, Leo Famulari wrote:
     If the system clock is more than 1000 seconds off, ntpd will exit without
     adjusting the clock.
     
     Reported by reepca on #guix.
     
     * gnu/services/networking.scm (ntp-shepherd-service): Pass '-g' when
     starting the NTP daemon.
     ---
      gnu/services/networking.scm | 2 +-
      1 file changed, 1 insertion(+), 1 deletion(-)
     
     diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
     index 7495179..5261e38 100644
     --- a/gnu/services/networking.scm
     +++ b/gnu/services/networking.scm
     @@ -296,7 +296,7 @@ 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" "-g")))
                    (stop #~(make-kill-destructor))))))))
      
      (define %ntp-accounts
     -- 
     2.10.1
Leo Famulari - Oct. 13, 2016, 2:12 p.m.
On Thu, Oct 13, 2016 at 07:06:50AM +0200, John Darrington wrote:
> I think that this should be a configuration item in the service, so that the
> user can decide whether to have it or not.  I don't think we should force it
> on the user.   Some applications break if the clock makes large jumps.

I agree. This is really something that the system administrator should
evaluate and fix on a case-by-case basis.
  
> The ntpd authors decided that the default behaviour is not to make large jumps
> so I think we should respect that unless there is a good reason to do otherwise.
> So I think this should be configurable in /etc/config.scm and the default should
> be not to use -g

For me, I have to do this so rarely (and never on the machines I
currently use) that I am fine with having to run `ntpd -g ...` by hand.

So, if we want to make this configurable in the OS configuration,
volunteers are welcome to work on it :)

Patch

diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 7495179..5261e38 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -296,7 +296,7 @@  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" "-g")))
               (stop #~(make-kill-destructor))))))))
 
 (define %ntp-accounts