From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKiRO-000554-58 for guix-patches@gnu.org; Fri, 01 Dec 2017 05:21:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKiRK-00050c-03 for guix-patches@gnu.org; Fri, 01 Dec 2017 05:21:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:58618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eKiRJ-00050S-SA for guix-patches@gnu.org; Fri, 01 Dec 2017 05:21:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eKiRJ-0000ND-K3 for guix-patches@gnu.org; Fri, 01 Dec 2017 05:21:01 -0500 Subject: [bug#29483] [PATCH] services: Add openntpd service. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20171128090443.15544-1-efraim@flashner.co.il> Date: Fri, 01 Dec 2017 11:19:57 +0100 In-Reply-To: <20171128090443.15544-1-efraim@flashner.co.il> (Efraim Flashner's message of "Tue, 28 Nov 2017 11:04:43 +0200") Message-ID: <87lgimiwc2.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Efraim Flashner Cc: 29483@debbugs.gnu.org Hello! Efraim Flashner skribis: > * gnu/packages/ntp.scm (openntpd)[arguments]: Add 'configure-flags to > set openntpd daemon's user and protected path. Add a custom phase to not > try to create said directory at install time. > * gnu/services/networking.scm (): New record type. > (openntpd-shepherd-service, openntpd-service-activation): New procedures. > (openntpd-service-type): New variable. > * doc/guix.texi (Networking Services): Add openntpd documentation. Nice! > +@cindex Openntpd =E2=80=9COpenNTPD=E2=80=9D maybe? Or all lower case? > +@deffn {Scheme Procedure} openntpd-service [#:openntpd @var{openntpd}] @ > + [#:servers @var{%ntp-servers}] @ > + [#:allow-large-adjustment? #f] > +Return a service that runs the daemon from @var{openntpd}, the > +@uref{http://www.openntpd.org, OpenNTPD package}. The daemon will > +keep the system clock synchronized with that of @var{servers}. > +@var{allow-large-adjustment?} determines whether @command{ntpd} is allow= ed to > +make an initial adjustment of more than 180 seconds." > +@end deffn The convention now is to expose and document the configuration record type and the service type, and to not provide a =E2=80=9Cfoo-service=E2=80= =9D procedure. Could you adjust accordingly? > +(define-record-type* > + openntpd-configuration make-openntpd-configuration > + openntpd-configuration? > + (openntpd openntpd-configuration-openntpd > + (default openntpd)) > + (servers openntpd-configuration-servers) Probably with: (default %ntp-servers). > +# Only listen on localhost > +listen on 127.0.0.1 > +listen on ::1 > + > +# Query the 'Date' from trusted HTTPS servers via TLS. > +constraint from www.gnu.org\n")) It would be nice to make that constraint server configurable too (not a blocker though). > + (list (shepherd-service > + (provision '(openntpd)) Perhaps we should make that =E2=80=98ntpd=E2=80=99 so that it conflicts wit= h the other ntpd. > +(define openntpd-service-type > + (service-type (name 'openntpd) > + (extensions > + (list (service-extension shepherd-root-service-type > + openntpd-shepherd-service) > + (service-extension account-service-type > + (const %ntp-accounts)) Are you sure that it uses those accounts? > + "Run the @command{ntpd}, the Network Time Protocol (NTP) > +daemon of the @uref{http://www.ntp.org, Network Time Foundation}, as ^---- remove -------------------------------------------^ > +implemented by OpenNTPD. The daemon will keep the system clock synchron= ized > +with that of the given servers."))) > + > +(define* (openntpd-service #:key (openntpd openntpd) > + (servers %ntp-servers) > + allow-large-adjustment?) Remove. Could you send an updated patch? Thank you! Ludo=E2=80=99.