From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/1] services: ntpd: Make large clock adjustments if necessary. Date: Thu, 20 Oct 2016 21:44:24 +0200 Message-ID: <87oa2eztyf.fsf@gnu.org> References: <20161013050650.GA25727@jocasta.intra> <20161013141246.GA7431@jasmine> <87h9883vz7.fsf@gnu.org> <20161019213906.GA29612@jasmine> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxJGS-0007I5-2F for guix-devel@gnu.org; Thu, 20 Oct 2016 15:44:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxJGN-0001iD-6O for guix-devel@gnu.org; Thu, 20 Oct 2016 15:44:32 -0400 In-Reply-To: <20161019213906.GA29612@jasmine> (Leo Famulari's message of "Wed, 19 Oct 2016 17:39:06 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari Cc: guix-devel@gnu.org Leo Famulari skribis: > On Wed, Oct 19, 2016 at 10:49:32PM +0200, Ludovic Court=C3=A8s wrote: >> diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm >> index 7495179..ce281c5 100644 >> --- a/gnu/services/networking.scm >> +++ b/gnu/services/networking.scm >> @@ -265,11 +265,13 @@ Protocol (DHCP) client, on all the non-loopback ne= twork 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))) >>=20=20 >> (define ntp-shepherd-service >> (match-lambda >> - (($ ntp servers) >> + (($ 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)))))))) >>=20=20 >> (define %ntp-accounts >> @@ -331,10 +336,13 @@ restrict -6 ::1\n")) >> ntp-service-activation))))) >>=20=20 >> (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 w= ill >> -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 allo= wed to >> +make an initial adjustment of more than 1,000 seconds." >> (service ntp-service-type >> (ntp-configuration (ntp ntp) (servers servers)))) >>=20=20 > >>=20 >> If that=E2=80=99s fine with you, I=E2=80=99ll commit it with a doc updat= e. > > It looks good to me! Once we can run GuixSD on armhf or aarch64, I bet > we will have lots of users with hardware lacking a battery-backed real > time clock, and they will appreciate this option. Good point. Pushed as dc0322b51111d12e1d97e2cc456100c44dd31bb6. Ludo=E2=80=99.