From patchwork Sat Feb 25 18:57:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47334 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6479216B96; Sat, 25 Feb 2023 19:05:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1CE0616B42 for ; Sat, 25 Feb 2023 19:05:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVzqz-0004tf-9i; Sat, 25 Feb 2023 14:05:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVzqx-0004tG-J9 for guix-patches@gnu.org; Sat, 25 Feb 2023 14:05:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVzqx-0002Oz-8w for guix-patches@gnu.org; Sat, 25 Feb 2023 14:05:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVzqx-0008E6-3q for guix-patches@gnu.org; Sat, 25 Feb 2023 14:05:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61789] [PATCH 06/27] services: base: Deprecate 'nscd-service' procedure. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Feb 2023 19:05:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61789 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61789@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61789-submit@debbugs.gnu.org id=B61789.167735187231566 (code B ref 61789); Sat, 25 Feb 2023 19:05:03 +0000 Received: (at 61789) by debbugs.gnu.org; 25 Feb 2023 19:04:32 +0000 Received: from localhost ([127.0.0.1]:41553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVzqS-0008Cz-96 for submit@debbugs.gnu.org; Sat, 25 Feb 2023 14:04:32 -0500 Received: from smtpm5.myservices.hosting ([185.26.105.236]:36272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVzqP-0008Ch-Mm for 61789@debbugs.gnu.org; Sat, 25 Feb 2023 14:04:30 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm5.myservices.hosting (Postfix) with ESMTP id 016F520D5C for <61789@debbugs.gnu.org>; Sat, 25 Feb 2023 20:04:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 3DD808009B; Sat, 25 Feb 2023 19:58:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Kn8aYiy1FlvD; Sat, 25 Feb 2023 19:58:18 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 9AFE480098; Sat, 25 Feb 2023 19:58:18 +0100 (CET) From: Bruno Victal Date: Sat, 25 Feb 2023 18:57:52 +0000 Message-Id: <0da8efddd398e31d71fd879745c9f3da7fd735db.1677350249.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Application Setup): Compress @cindex entries. (Base Services): Compress @cindex entries. Delete %nscd-default-configuration. Replace 'nscd-service' with 'nscd-service-type'. * gnu/services/base.scm (%nscd-default-configuration): Deprecate variable. (nscd-service): Deprecate procedure. * gnu/system/install.scm (%installation-services): Use nscd-service-type. --- doc/guix.texi | 25 +++++++------------------ gnu/services/base.scm | 12 +++++++----- gnu/system/install.scm | 5 +++-- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f4bdb6b211..86edc58b40 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1976,8 +1976,7 @@ Application Setup @cindex name service switch, glibc @cindex NSS (name service switch), glibc -@cindex nscd (name service caching daemon) -@cindex name service caching daemon (nscd) +@cindex @abbr{nscd, name service cache daemon} When using Guix on a foreign distro, we @emph{strongly recommend} that the system run the GNU C library's @dfn{name service cache daemon}, @command{nscd}, which should be listening on the @@ -18390,20 +18389,17 @@ Base Services @end table @end deftp -@cindex name service cache daemon -@cindex nscd -@deffn {Scheme Procedure} nscd-service [@var{config}] [#:glibc glibc] @ - [#:name-services '()] -Return a service that runs the libc name service cache daemon (nscd) with the -given @var{config}---an @code{} object. @xref{Name -Service Switch}, for an example. +@cindex @abbr{nscd, name service cache daemon} +@defvar nscd-service-type +Type of the service that runs the libc @abbr{nscd, name service cache +daemon}, whose value is a @code{} object. For convenience, the Shepherd service for nscd provides the following actions: @table @code @item invalidate -@cindex cache invalidation, nscd @cindex nscd, cache invalidation +@cindex cache invalidation, nscd This invalidate the given cache. For instance, running: @example @@ -18417,17 +18413,10 @@ Base Services Running @command{herd statistics nscd} displays information about nscd usage and caches. @end table - -@end deffn - -@defvar %nscd-default-configuration -This is the default @code{} value (see below) used -by @code{nscd-service}. It uses the caches defined by -@code{%nscd-default-caches}; see below. @end defvar @deftp {Data Type} nscd-configuration -This is the data type representing the name service cache daemon (nscd) +Data type representing the @abbr{nscd, name service cache daemon} configuration. @table @asis diff --git a/gnu/services/base.scm b/gnu/services/base.scm index c5fd0cf5b4..423a38e39d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -177,7 +177,7 @@ (define-module (gnu services base) mingetty-service-type %nscd-default-caches - %nscd-default-configuration + %nscd-default-configuration ; deprecated nscd-configuration nscd-configuration? @@ -186,7 +186,7 @@ (define-module (gnu services base) nscd-cache? nscd-service-type - nscd-service + nscd-service ; deprecated syslog-configuration syslog-configuration? @@ -1343,7 +1343,8 @@ (define %nscd-default-caches (check-files? #t) ;check /etc/services changes (persistent? #t)))) -(define %nscd-default-configuration +(define-deprecated %nscd-default-configuration + #f ;; Default nscd configuration. (nscd-configuration)) @@ -1497,13 +1498,14 @@ (define nscd-service-type (name-services (append (nscd-configuration-name-services config) name-services))))) - (default-value %nscd-default-configuration) + (default-value (nscd-configuration)) (description "Runs libc's @dfn{name service cache daemon} (nscd) with the given configuration---an @code{} object. @xref{Name Service Switch}, for an example."))) -(define* (nscd-service #:optional (config %nscd-default-configuration)) +(define-deprecated (nscd-service #:optional (config (nscd-configuration))) + nscd-service-type "Return a service that runs libc's name service cache daemon (nscd) with the given @var{config}---an @code{} object. @xref{Name Service Switch}, for an example." diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 1b05a862c6..f7de0d6a09 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -426,8 +426,9 @@ (define* (%installation-services #:key (system (or (and=> ;; Since this is running on a USB stick with a overlayfs as the root ;; file system, use an appropriate cache configuration. - (nscd-service (nscd-configuration - (caches %nscd-minimal-caches))) + (service nscd-service-type + (nscd-configuration + (caches %nscd-minimal-caches))) ;; Having /bin/sh is a good idea. In particular it allows Tramp ;; connections to this system to work.