Received: (at 41180) by debbugs.gnu.org; 9 Mar 2023 12:24:35 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 09 07:24:35 2023 Received: from localhost ([127.0.0.1]:51096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1paFJy-0003Yo-61 for submit <at> debbugs.gnu.org; Thu, 09 Mar 2023 07:24:35 -0500 Received: from sail-ipv4.us-core.com ([208.82.101.137]:44622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <felix.lechner@HIDDEN>) id 1paFJv-0003Yf-Dx for 41180 <at> debbugs.gnu.org; Thu, 09 Mar 2023 07:24:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=6QtUwDNslxoo/qJ OBXEaUKohb7F4IULDzLVmQb/YcUM=; h=date:subject:cc:to:from; d=lease-up.com; b=lsOd3bqCBHBYHKIO9gSsTZ5tjQWRV2f2g/3aQ5eKI3m2fxathnyO tM4KmnM2/3fdpl5BgDgZFzecwZ6rEG+FtGPECUce+25X5pMzI5VqvN09360Q58lamIUad9 bDkHzCaj8uQlUPT54sIgKLzHPaLmdX1KMXPT1YH0i3bzIbVDk= Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id b466e084 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Thu, 9 Mar 2023 12:24:29 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 6c324a17; Thu, 9 Mar 2023 12:24:29 +0000 (UTC) From: Felix Lechner <felix.lechner@HIDDEN> To: 41180 <at> debbugs.gnu.org Subject: [PATCH v2] gnu: services: Add cachefilesd service. (Closes: #41180) Date: Thu, 9 Mar 2023 04:24:11 -0800 Message-Id: <2fddf19e501fecb23a3f14f112871880a0475e1f.1678364641.git.felix.lechner@HIDDEN> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 41180 Cc: Bruno Victal <mirai@HIDDEN>, Felix Lechner <felix.lechner@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) Thanks to Bruno Victal "mirai" for cooperating on this patch and for generously sharing a wealth of insights about Guix services. Thanks to Jean-Baptiste Note for an early version of this service! Co-authored-by: Bruno Victal <mirai@HIDDEN> --- doc/guix.texi | 90 +++++++++++++++++ gnu/local.mk | 1 + gnu/services/linux.scm | 200 +++++++++++++++++++++++++++++++++++++- gnu/tests/cachefilesd.scm | 71 ++++++++++++++ 4 files changed, 361 insertions(+), 1 deletion(-) create mode 100644 gnu/tests/cachefilesd.scm diff --git a/doc/guix.texi b/doc/guix.texi index 6671ba9305..c1a68707d2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -113,6 +113,7 @@ Copyright @copyright{} 2022–2023 Bruno Victal@* Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@* Copyright @copyright{} 2023 Giacomo Leidi@* Copyright @copyright{} 2022 Antero Mejr@* +Copyright @copyright{} 2023 Felix Lechner@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -37473,6 +37474,95 @@ parameters, can be done as follow: @end lisp @end defvar +@cindex cachefilesd +@cindex cachefiles +@cindex fscache +@subsubheading Cachefilesd Service + +The Cachefilesd service starts a daemon that caches network filesystem +data locally. It is especially useful for NFS and AFS shares, where it +reduces latencies for repeated access when reading files. + +The daemon can be started as follows: + +@lisp +(service cachefilesd-service-type + (cachefilesd-configuration + (cache-directory "/var/cache/fscache"))) +@end lisp + +@defvar cachefilesd-service-type +The service type for starting @command{cachefilesd}. The value for this +service type is a @code{cachefilesd-configuration}, whose only required +field is @var{cache-directory}. + +@end defvar + +@c %start of fragment +@deftp {Data Type} cachefilesd-configuration +Available @code{cachefilesd-configuration} fields are: + +@table @asis +@item @code{cachefilesd} (default: @code{cachefilesd}) (type: file-like) +The cachefilesd package to use. + +@item @code{debug-output?} (default: @code{#f}) (type: boolean) +Print debugging output to stderr. + +@item @code{use-syslog?} (default: @code{#t}) (type: boolean) +Log to syslog facility instead of stdout. + +@item @code{scan?} (default: @code{#t}) (type: boolean) +Scan for cachable objects. + +@item @code{cache-directory} (type: maybe-string) +Location of the cache directory. + +@item @code{cache-name} (default: @code{"CacheFiles"}) (type: maybe-string) +Name of cache (keep unique). + +@item @code{security-context} (type: maybe-string) +SELinux security context. + +@item @code{pause-culling-for-block-percentage} (default: @code{7}) (type: maybe-non-negative-integer) +Pause culling when available blocks exceed this percentage. + +@item @code{pause-culling-for-file-percentage} (default: @code{7}) (type: maybe-non-negative-integer) +Pause culling when available files exceed this percentage. + +@item @code{resume-culling-for-block-percentage} (default: @code{5}) (type: maybe-non-negative-integer) +Start culling when available blocks drop below this percentage. + +@item @code{resume-culling-for-file-percentage} (default: @code{5}) (type: maybe-non-negative-integer) +Start culling when available files drop below this percentage. + +@item @code{pause-caching-for-block-percentage} (default: @code{1}) (type: maybe-non-negative-integer) +Pause further allocations when available blocks drop below this +percentage. + +@item @code{pause-caching-for-file-percentage} (default: @code{1}) (type: maybe-non-negative-integer) +Pause further allocations when available files drop below this +percentage. + +@item @code{log2-table-size} (default: @code{12}) (type: maybe-non-negative-integer) +Size of tables holding cullable objects in logarithm of base 2. + +@item @code{cull?} (default: @code{#t}) (type: boolean) +Create free space by culling (consumes system load). + +@item @code{trace-function-entry-in-kernel-module?} (default: @code{#f}) (type: boolean) +Trace function entry in the kernel module (for debugging). + +@item @code{trace-function-exit-in-kernel-module?} (default: @code{#f}) (type: boolean) +Trace function exit in the kernel module (for debugging). + +@item @code{trace-internal-checkpoints-in-kernel-module?} (default: @code{#f}) (type: boolean) +Trace internal checkpoints in the kernel module (for debugging). + +@end table +@end deftp +@c %end of fragment + @cindex rasdaemon @cindex Platform Reliability, Availability and Serviceability daemon @subsubheading Rasdaemon Service diff --git a/gnu/local.mk b/gnu/local.mk index 6c5a9ce024..a4e0e4ec55 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -759,6 +759,7 @@ GNU_SYSTEM_MODULES = \ %D%/tests.scm \ %D%/tests/audio.scm \ %D%/tests/base.scm \ + %D%/tests/cachefilesd.scm \ %D%/tests/ci.scm \ %D%/tests/cups.scm \ %D%/tests/databases.scm \ diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm index 60e2093e1d..e581291a7b 100644 --- a/gnu/services/linux.scm +++ b/gnu/services/linux.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@HIDDEN> ;;; Copyright © 2021 B. Wilson <elaexuotee@HIDDEN> ;;; Copyright © 2022 Josselin Poiret <dev@HIDDEN> +;;; Copyright © 2023 Felix Lechner <felix.lechner@HIDDEN> ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,12 +31,14 @@ (define-module (gnu services linux) #:use-module (guix ui) #:use-module (gnu services) #:use-module (gnu services base) + #:use-module (gnu services configuration) #:use-module (gnu services shepherd) #:use-module (gnu packages linux) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (ice-9 format) #:use-module (ice-9 match) #:export (earlyoom-configuration earlyoom-configuration? @@ -52,6 +55,28 @@ (define-module (gnu services linux) kernel-module-loader-service-type + cachefilesd-configuration + cachefilesd-configuration? + cachefilesd-configuration-cachefilesd + cachefilesd-configuration-debug-output? + cachefilesd-configuration-use-syslog? + cachefilesd-configuration-scan? + cachefilesd-configuration-cache-directory + cachefilesd-configuration-cache-name + cachefilesd-configuration-security-context + cachefilesd-configuration-pause-culling-for-block-percentage + cachefilesd-configuration-pause-culling-for-file-percentage + cachefilesd-configuration-resume-culling-for-block-percentage + cachefilesd-configuration-resume-culling-for-file-percentage + cachefilesd-configuration-pause-caching-for-block-percentage + cachefilesd-configuration-pause-caching-for-file-percentage + cachefilesd-configuration-log2-table-size + cachefilesd-configuration-cull? + cachefilesd-configuration-trace-function-entry-in-kernel-module + cachefilesd-configuration-trace-function-exit-in-kernel-module + cachefilesd-configuration-trace-internal-checkpoints-in-kernel-module + cachefilesd-service-type + rasdaemon-configuration rasdaemon-configuration? rasdaemon-configuration-record? @@ -198,6 +223,179 @@ (define kernel-module-loader-service-type (extend append) (default-value '()))) + +;;; +;;; Cachefilesd, an FS-Cache daemon +;;; + +(define (serialize-string variable-symbol value) + #~(format #f "~a ~a~%" #$(symbol->string variable-symbol) #$value)) + +(define-maybe string) + +(define (non-negative-integer? val) + (and (exact-integer? val) (not (negative? val)))) + +(define (serialize-non-negative-integer variable-symbol value) + #~(format #f "~a ~d~%" #$(symbol->string variable-symbol) #$value)) + +(define-maybe non-negative-integer) + +(define (make-option-serializer option-symbol) + (lambda (variable-symbol text) + (if (maybe-value-set? text) + #~(format #f "~a ~a~%" #$(symbol->string option-symbol) #$text) + ""))) + +(define (make-percentage-threshold-serializer threshold-symbol) + (lambda (variable-symbol percentage) + (if (maybe-value-set? percentage) + #~(format #f "~a ~a%~%" #$(symbol->string threshold-symbol) #$percentage) + ""))) + +(define-configuration cachefilesd-configuration + (cachefilesd + (file-like cachefilesd) + "The cachefilesd package to use." + empty-serializer) + + ;; command-line options + (debug-output? + (boolean #f) + "Print debugging output to stderr." + empty-serializer) + + (use-syslog? + (boolean #t) + "Log to syslog facility instead of stdout." + empty-serializer) + + ;; culling is part of the configuration file + ;; despite the name of the command-line option + (scan? + (boolean #t) + "Scan for cachable objects." + empty-serializer) + + ;; sole required field in the configuration file + (cache-directory + maybe-string + "Location of the cache directory." + (make-option-serializer 'dir)) + + (cache-name + (maybe-string "CacheFiles") + "Name of cache (keep unique)." + (make-option-serializer 'tag)) + + (security-context + maybe-string + "SELinux security context." + (make-option-serializer 'secctx)) + + ;; percentage thresholds in the configuration file + (pause-culling-for-block-percentage + (maybe-non-negative-integer 7) + "Pause culling when available blocks exceed this percentage." + (make-percentage-threshold-serializer 'brun)) + + (pause-culling-for-file-percentage + (maybe-non-negative-integer 7) + "Pause culling when available files exceed this percentage." + (make-percentage-threshold-serializer 'frun)) + + (resume-culling-for-block-percentage + (maybe-non-negative-integer 5) + "Start culling when available blocks drop below this percentage." + (make-percentage-threshold-serializer 'bcull)) + + (resume-culling-for-file-percentage + (maybe-non-negative-integer 5) + "Start culling when available files drop below this percentage." + (make-percentage-threshold-serializer 'fcull)) + + (pause-caching-for-block-percentage + (maybe-non-negative-integer 1) + "Pause further allocations when available blocks drop below this percentage." + (make-percentage-threshold-serializer 'bstop)) + + (pause-caching-for-file-percentage + (maybe-non-negative-integer 1) + "Pause further allocations when available files drop below this percentage." + (make-percentage-threshold-serializer 'fstop)) + + ;; run time optimizations in the configuration file + (log2-table-size + (maybe-non-negative-integer 12) + "Size of tables holding cullable objects in logarithm of base 2." + (make-option-serializer 'culltable)) + + (cull? + (boolean #t) + "Create free space by culling (consumes system load)." + (lambda (variable-symbol value) + (if value "" "nocull\n"))) + + ;; kernel module debugging in the configuration file + (trace-function-entry-in-kernel-module? + (boolean #f) + "Trace function entry in the kernel module (for debugging)." + empty-serializer) + + (trace-function-exit-in-kernel-module? + (boolean #f) + "Trace function exit in the kernel module (for debugging)." + empty-serializer) + + (trace-internal-checkpoints-in-kernel-module? + (boolean #f) + "Trace internal checkpoints in the kernel module (for debugging)." + empty-serializer)) + +(define (serialize-cachefilesd-configuration configuration) + (mixed-text-file + "cachefilesd.conf" + (serialize-configuration configuration cachefilesd-configuration-fields))) + +(define (cachefilesd-shepherd-service config) + "Return a list of <shepherd-service> for cachefilesd for CONFIG." + (match-record + config <cachefilesd-configuration> (cachefilesd + debug-output? + use-syslog? + scan? + cache-directory) + (let ((configuration-file (serialize-cachefilesd-configuration config))) + (shepherd-service + (documentation "Run the cachefilesd daemon for FS-Cache.") + (provision '(cachefilesd)) + (requirement (append '(file-systems) + (if use-syslog? '(syslogd) '()))) + (start #~(begin + (and=> #$(maybe-value cache-directory) mkdir-p) + (make-forkexec-constructor + `(#$(file-append cachefilesd "/sbin/cachefilesd") + ;; do not detach + "-n" + #$@(if debug-output? '("-d") '()) + #$@(if use-syslog? '() '("-s")) + #$@(if scan? '() '("-N")) + "-f" #$configuration-file)))) + (stop #~(make-kill-destructor)))))) + +(define cachefilesd-service-type + (service-type + (name 'cachefilesd) + (description + "Run the FS-Cache backend daemon @command{cachefilesd}.") + (extensions + (list + (service-extension kernel-module-loader-service-type + (const '("cachefiles"))) + (service-extension shepherd-root-service-type + (compose list cachefilesd-shepherd-service)))) + (default-value (cachefilesd-configuration)))) + ;;; ;;; Reliability, Availability, and Serviceability (RAS) daemon @@ -243,7 +441,7 @@ (define rasdaemon-service-type ;;; -;;; Kernel module loader. +;;; Zram device ;;; (define-record-type* <zram-device-configuration> diff --git a/gnu/tests/cachefilesd.scm b/gnu/tests/cachefilesd.scm new file mode 100644 index 0000000000..7f5d513067 --- /dev/null +++ b/gnu/tests/cachefilesd.scm @@ -0,0 +1,71 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@HIDDEN> +;;; Copyright © 2022 Bruno Victal <mirai@HIDDEN> +;;; Copyright © 2023 Felix Lechner <felix.lechner@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu tests cachefilesd) + #:use-module (gnu tests) + #:use-module (gnu system) + #:use-module (gnu system vm) + #:use-module (gnu services) + #:use-module (gnu services linux) + #:use-module (guix gexp) + #:export (%test-cachefilesd)) + +(define %cachefilesd-os + (simple-operating-system + (service cachefilesd-service-type + (cachefilesd-configuration + (cache-directory "/var/cache/fscache"))))) + +(define (run-cachefilesd-test) + "Run tests in %cachefilesd-os, which has cachefilesd running." + (define os + (marionette-operating-system + %cachefilesd-os + #:imported-modules '((gnu services herd)))) + + (define vm + (virtual-machine os)) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-64) + (gnu build marionette)) + (define marionette + (make-marionette (list #$vm))) + + (test-runner-current (system-test-runner #$output)) + (test-begin "cachefilesd") + + (test-assert "service is running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'cachefilesd)) + marionette)) + + (test-end)))) + (gexp->derivation "cachefilesd-test" test)) + +(define %test-cachefilesd + (system-test + (name "cachefilesd") + (description "Test that the cachefilesd runs when started.") + (value (run-cachefilesd-test)))) -- 2.39.1
guix-patches@HIDDEN
:bug#41180
; Package guix-patches
.
Full text available.Received: (at 41180) by debbugs.gnu.org; 2 Sep 2020 14:58:30 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 02 10:58:30 2020 Received: from localhost ([127.0.0.1]:60304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kDUDW-0002h1-Bw for submit <at> debbugs.gnu.org; Wed, 02 Sep 2020 10:58:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <othacehe@HIDDEN>) id 1kDUDU-0002gq-BC for 41180 <at> debbugs.gnu.org; Wed, 02 Sep 2020 10:58:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46498) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <othacehe@HIDDEN>) id 1kDUDO-0005O0-58; Wed, 02 Sep 2020 10:58:22 -0400 Received: from [2a01:e0a:19b:d9a0:9d9d:97cc:d92a:8ac0] (port=57670 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <othacehe@HIDDEN>) id 1kDUDN-0001bO-7C; Wed, 02 Sep 2020 10:58:21 -0400 From: Mathieu Othacehe <othacehe@HIDDEN> To: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> Subject: Re: [bug#41180] [PATCH] Add cachefilesd service. References: <87v9l3zjg7.fsf@HIDDEN> <87k118unsc.fsf@HIDDEN> <87367ucpdj.fsf@HIDDEN> Date: Wed, 02 Sep 2020 16:58:19 +0200 In-Reply-To: <87367ucpdj.fsf@HIDDEN> (Jean-Baptiste Note's message of "Wed, 20 May 2020 20:39:36 +0000") Message-ID: <87mu28ted0.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41180 Cc: 41180 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hello Jean-Baptiste, > Thanks a lot for the various documentation pointers and style > recommendation. I really appreciate all of this! > > I will provide a comprehensive patch with your changes integrated, and a > test, as soon as i am happy with it -- or just give up writing the > perfect test. Any progress on that one :)? Do not hesitate to ask some help here or on #guix if needed. Thanks, Mathieu
guix-patches@HIDDEN
:bug#41180
; Package guix-patches
.
Full text available.Received: (at 41180) by debbugs.gnu.org; 23 May 2020 06:44:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 23 02:44:16 2020 Received: from localhost ([127.0.0.1]:33264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jcNtI-0000Qu-I0 for submit <at> debbugs.gnu.org; Sat, 23 May 2020 02:44:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <othacehe@HIDDEN>) id 1jcNtH-0000Qa-9z for 41180 <at> debbugs.gnu.org; Sat, 23 May 2020 02:44:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39477) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <othacehe@HIDDEN>) id 1jcNtB-0005pK-Rz; Sat, 23 May 2020 02:44:09 -0400 Received: from [2a01:e0a:fa:a50:7ced:409d:b570:ed70] (port=37402 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <othacehe@HIDDEN>) id 1jcNtB-0002ZK-9N; Sat, 23 May 2020 02:44:09 -0400 From: Mathieu Othacehe <othacehe@HIDDEN> To: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> Subject: Re: [bug#41180] [PATCH] Add cachefilesd service. References: <87v9l3zjg7.fsf@HIDDEN> <87k118unsc.fsf@HIDDEN> <87367ucpdj.fsf@HIDDEN> Date: Sat, 23 May 2020 08:44:07 +0200 In-Reply-To: <87367ucpdj.fsf@HIDDEN> (Jean-Baptiste Note's message of "Wed, 20 May 2020 20:39:36 +0000") Message-ID: <87lfljcfrc.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41180 Cc: 41180 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hello Jean-Baptiste, > Thanks a lot for the various documentation pointers and style > recommendation. I really appreciate all of this! > > I will provide a comprehensive patch with your changes integrated, and a > test, as soon as i am happy with it -- or just give up writing the > perfect test. Great :) I think that checking that the module is loaded, and the cachefilesd service is running is already a first step. You can also check for some properties in the sysfs, but unless you're already there, maybe you don't need to push much further! Thanks, Mathieu
guix-patches@HIDDEN
:bug#41180
; Package guix-patches
.
Full text available.Received: (at 41180) by debbugs.gnu.org; 20 May 2020 20:39:58 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 20 16:39:58 2020 Received: from localhost ([127.0.0.1]:54431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jbVVO-0004GB-Bz for submit <at> debbugs.gnu.org; Wed, 20 May 2020 16:39:58 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37635) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jbnote@HIDDEN>) id 1jbVVN-0004Fy-5Y for 41180 <at> debbugs.gnu.org; Wed, 20 May 2020 16:39:57 -0400 Received: by mail-wr1-f66.google.com with SMTP id l17so4520694wrr.4 for <41180 <at> debbugs.gnu.org>; Wed, 20 May 2020 13:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=EHBTsPzfhleAIO8tcL9yUy9aSTLJacaGAp8/30xLMDA=; b=kkCkxybznXmv40Jwm+a/Q6OuKFGlfac5jnNR0NJ8cnFuo/s30T2/9ALQEZmSdUWaQT BRDsTSxRlIs41rnIxoT4zj8OM9f7S2COcuKMK9tnKYycPWjpA3t0fQJeYuYzuchchHab 9Sg3ogwubFeI5HeNZXlnkH1lBV4noN0Omv6kl1l9iok+HUGTjnovjSC8zTFcUz4rcMIT iO98j4dBOG0azLnWuv0uDC/8Wra3sZalyyzIgrdF/nNGguWIN1YXBcXZC/LdN0to/V+s FABfakpQpxPu/esYHGIKDHo7lerAbrdCuJzaty0LzA22UZ5yNXi23JrIt80wrWCapW5N U9yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=EHBTsPzfhleAIO8tcL9yUy9aSTLJacaGAp8/30xLMDA=; b=atLeZbrJPxlPx4IK4iNJWKLiHjItsB9oYrxKderCNyu6IJel+UQVPgAt3HybxZYQk5 9+OywYjO68oph6tjQSjB/TeSIatvEm186nchMsc4+5nkAQrjV7sQkgiztY+DNkWgefCp RfwCMXrZX21vXdss320ntNiAGTbGveZtFV7RIIwmvgogclhUZnBiP98V70neGLo8EZDd L2rCvHCqN/hHQHsc/V3K1qzC3bd3l5K8rhQbrQEtCpUcDFWndRHchlbbj7eJyIDby+ZJ GrjPlLK5PwIzNAL2pV4JuPP8xESazmxaLmVaXUxs6ahj1A0UWL1OQ2uLB8YaWxRyX5Cb o4kQ== X-Gm-Message-State: AOAM533hg2hWcZbIJQBFTt18h4BKwUfHnMpkCmgw4V6D3funXJrNr+7M a10Vkf3YqMNNfUbPZCmly3QMqBU0uE0= X-Google-Smtp-Source: ABdhPJzDCVioeEg/6kO6dvHWdxg2x4YRCtM6wzSNZ1v7sUrgq6x/0MmWawTvMROK9X9GdVkuM/XRiQ== X-Received: by 2002:adf:c414:: with SMTP id v20mr5360673wrf.379.1590007190576; Wed, 20 May 2020 13:39:50 -0700 (PDT) Received: from guixrules ([2a01:e35:2e0b:a6b0:e2ce:c3ff:fe74:cec8]) by smtp.gmail.com with ESMTPSA id b7sm4056876wmj.29.2020.05.20.13.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 13:39:48 -0700 (PDT) From: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> To: Mathieu Othacehe <othacehe@HIDDEN> Subject: Re: [bug#41180] [PATCH] Add cachefilesd service. References: <87v9l3zjg7.fsf@HIDDEN> <87k118unsc.fsf@HIDDEN> Date: Wed, 20 May 2020 20:39:36 +0000 In-Reply-To: <87k118unsc.fsf@HIDDEN> (Mathieu Othacehe's message of "Tue, 19 May 2020 14:12:03 +0200") Message-ID: <87367ucpdj.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 41180 Cc: 41180 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.5 (/) --=-=-= Content-Type: text/plain Hi Mathieu, Thanks a lot for taking so much time to help me out and review this patch. Following your previous mail, I'm currently writing a test. I may follow NFS's tests rather than CUPS -- (some of) NFS' tests just checks from within the marionette that the service has been started, while CUPS verifies from the outside that an external service is correctly running. While I do prefer the CUPS test -- verify at the "user level" that the service is provided -- it seems very complex to me to test cachefilesd at a high level with a binary decision and no false positive. Venues for this could be: - maybe an NFS mount with the fsc option when cachefilesd is not activated will fail -- I need to check that; - or maybe mounting some NFS share with fsc, accessing it, and checking afterwards that the cache has been filled by cached data -- this is getting complex though, and probably not a clear-cut scenario. I don't know how high you will set the bar and if a simple 'check that the daemon is running' would be sufficient to you :) Thanks a lot for the various documentation pointers and style recommendation. I really appreciate all of this! I will provide a comprehensive patch with your changes integrated, and a test, as soon as i am happy with it -- or just give up writing the perfect test. Kind regards, Jean-Baptiste --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEPxcq3dp4FVY5UpckkC0pVsuz75YFAl7FlYgACgkQkC0pVsuz 75YGZxAAhizoSDCp66Nzs6FFGlKHE21PfqOB1nNF88ak/8kYd/mo+TLMN4CILaeh XlivhmK28z6XN8lyX2ou5P5VPgd7vK16uKUbu/l7rNsZPA8IuO6MnejSAeoPO3K6 2dYQyjgJKDYbwV9cRQUu8kcUrzOcjbvQmpX6mwZIIcdU4l/RystsH8ddDa/IrAfO +YQ9VxiR7U8NCrMFJSnO2N/wl/h2OOygFg1LBO9HEGrbehJBFQnXSjTLsJNJRqV6 Iq6FEIghm3OqGIgFfBbVJ6wGptTPaZOBleUGjcmoI52KZMu5y8AxkqXEjr2ly3ym J8qKdyW0hGxptBIYxICD78mjAe/JK/zwqqT4Z1DZnvbLQDTpcJn0+hHgGZBBFoK3 uIiI4FUjkFa+ML+8woFWCHA36DN62peU4XHilBYCgZWqGmh2RSMtSANjINp8uw6r 2XSUEMT1Wg8SRj3oynO8uGU/q/OBEqioelLRxEPO67YUgNoELcTbUwO0dmMqbUUf 7zP2Kz1sehT9762+9E7OpBTvPnk14xZNQK1IQb171AUmoIpaGMmUdT7VEq0CpyrV WVWfSVopCWNbMIuAxfC/jQkCHDigBNeSOPZZ9LSzhg/qE7bj89VD/NsBbiY98Pdo HI5/rM7yl0mLW+WIm3yD1SyL1cIusZ7lEO+MKKjAi2DIw379DMw= =bVBr -----END PGP SIGNATURE----- --=-=-=--
guix-patches@HIDDEN
:bug#41180
; Package guix-patches
.
Full text available.Received: (at 41180) by debbugs.gnu.org; 19 May 2020 12:12:14 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 19 08:12:14 2020 Received: from localhost ([127.0.0.1]:49464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jb16T-00073F-QK for submit <at> debbugs.gnu.org; Tue, 19 May 2020 08:12:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <othacehe@HIDDEN>) id 1jb16S-000731-LF for 41180 <at> debbugs.gnu.org; Tue, 19 May 2020 08:12:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49361) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <othacehe@HIDDEN>) id 1jb16M-0008QF-AW; Tue, 19 May 2020 08:12:06 -0400 Received: from [2a01:e0a:fa:a50:8c9b:160d:9e65:742a] (port=43110 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <othacehe@HIDDEN>) id 1jb16L-0006lM-P7; Tue, 19 May 2020 08:12:06 -0400 From: Mathieu Othacehe <othacehe@HIDDEN> To: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> Subject: Re: [bug#41180] [PATCH] Add cachefilesd service. References: <87v9l3zjg7.fsf@HIDDEN> Date: Tue, 19 May 2020 14:12:03 +0200 In-Reply-To: <87v9l3zjg7.fsf@HIDDEN> (Jean-Baptiste Note's message of "Sun, 10 May 2020 19:19:36 +0000") Message-ID: <87k118unsc.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41180 Cc: 41180 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hello, Overall, this looks nice! A few comments below. Note that you can merge this patch with the documentation patch. It would also be nice to add the associated system tests. > +(define-record-type* <cachefilesd-configuration> > + cachefilesd-configuration make-cachefilesd-configuration > + cachefilesd-configuration? > + > + ;; <package-path> > + (cachefilesd cachefilesd-configuration-cachefilesd > + (default cachefilesd)) > + You could write something more concise here by removing empty lines and adding the 'type' comment on the same line. > + (let ((secctx #$(cachefilesd-configuration-secctx config))) > + (if secctx (format port "secctx ~a" secctx))) You can use 'when' for one arm if conditions. > + > + ;; XXX factor this > + (format port "brun ~a%\n" > + #$(number->string > + (cachefilesd-configuration-brun config))) It would indeed be nice to factor it, maybe by creating an association table with the symbol name as CAR and the matching procedure as CDR. Something like: --8<---------------cut here---------------start------------->8--- '(("frun" . cachefilesd-configuration-frun) ("bcull" . cachefilesd-configuration-bcull)) --8<---------------cut here---------------end--------------->8--- then you could iterate on that list. > + (if #$(cachefilesd-configuration-nocull? config) > + (display "nocull\n" port)) Same as above. You can use 'when' or 'unless' instead of "(if test stmt)". > + ;; Make sure the cache directory and pid dir exists "dir" -> "directory". > + ;; XXX shepherd pid file handling: no idea how shepherd does it > + ;; and if it's going to conflict with cachefilesd's Shepherd documentation says: --8<---------------cut here---------------start------------->8--- When PID-FILE is true, it must be the name of a PID file associated with the process being launched; the return value is the PID once that file has been created. If PID-FILE does not show up in less than PID-FILE-TIMEOUT seconds, the service is considered as failing to start. --8<---------------cut here---------------end--------------->8--- So I think you can remove this comment. Thanks, Mathieu
guix-patches@HIDDEN
:bug#41180
; Package guix-patches
.
Full text available.Received: (at 41180) by debbugs.gnu.org; 11 May 2020 15:06:21 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 11 11:06:21 2020 Received: from localhost ([127.0.0.1]:52955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jYA0a-00064d-U7 for submit <at> debbugs.gnu.org; Mon, 11 May 2020 11:06:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <othacehe@HIDDEN>) id 1jYA0V-00064H-UP for 41180 <at> debbugs.gnu.org; Mon, 11 May 2020 11:06:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38012) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <othacehe@HIDDEN>) id 1jYA0Q-0003U8-Ig; Mon, 11 May 2020 11:06:10 -0400 Received: from [2a01:cb18:832e:5f00:fd66:fbb0:b5a6:36b6] (port=35294 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <othacehe@HIDDEN>) id 1jYA0Q-0004oL-1Y; Mon, 11 May 2020 11:06:10 -0400 From: Mathieu Othacehe <othacehe@HIDDEN> To: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> Subject: Re: [bug#41180] [PATCH] Add cachefilesd service. References: <87v9l3zjg7.fsf@HIDDEN> Date: Mon, 11 May 2020 17:06:08 +0200 In-Reply-To: <87v9l3zjg7.fsf@HIDDEN> (Jean-Baptiste Note's message of "Sun, 10 May 2020 19:19:36 +0000") Message-ID: <878shywly7.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41180 Cc: 41180 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hello Jean-Baptiste, Thanks for this service! > - I gathered that #~ / #$ kinds of suspends evaluation / forces it -- is > there documentation about this somewhere ? #~ and #$ are related to the Gexp mechanism. It's documented here: https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html. > - There's something that looks like a splat operator (only seen in > conjuction with forcing evaluation in #$@) -- again i'd be interested > in more documentation about this feature -- is this a guix-specific > operator? #$@ is a shortcut for ungexp-splicing. It's also documented in the link above. It can be a bit puzzling at start, don't hesitate to ask some help on #guix channel. > - I don't understand why there are ^L separating services in the scheme > files -- is this necessary? A convention? What purpose does it serve? Yes, see the "Pagination" section in https://mumble.net/~campbell/scheme/style.txt. You can install "emacs-page-break-lines" to replace it by cleaner lines. > Regarding the patch itself: > > - i'm not entirely sure the service belongs to services/linux.scm I think it's fine. > - there are no automated tests (beyond what I have done by hand > locally!), and there's no lint, so I don't really feel confident about > it :) Are there tests for services to alleviate my fears? It would be nice to implement tests along with the new service definition. You can have a look to (gnu tests cups) module for instance. It tests the cups service by spawning a virtual-machine called a "marionette". You could create a (gnu tests cachefilesd) doing a similar job. See "Running the Test Suite" in the info page for more details on how to run the test suite. > - I've copied some other service for modprobing the required kernel > modules before launching the daemon with a one-shot shepherd > service. Frankly i'm not happy about this solution, it seems to me > that it unnecessarily pollutes the shepherd configuration; maybe some > other mechanism (graft?) adjusting the modprobe configuration could be > better (better still, autoload the file). Any guidance would be nice > (including, that this solution is sufficient for now :)) The ideal would be that cachefilesd loads the appropriated module. If this is not possible, we can discuss extending kernel-module-loader-service-type service. But for now I guess it's ok. I hope it answers your questions, I'll review the rest of the service later on. Thanks, Mathieu
guix-patches@HIDDEN
:bug#41180
; Package guix-patches
.
Full text available.Received: (at 41180) by debbugs.gnu.org; 10 May 2020 19:27:52 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 10 15:27:52 2020 Received: from localhost ([127.0.0.1]:50444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jXrc7-0004VC-UT for submit <at> debbugs.gnu.org; Sun, 10 May 2020 15:27:52 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jbnote@HIDDEN>) id 1jXrc6-0004Uy-9X for 41180 <at> debbugs.gnu.org; Sun, 10 May 2020 15:27:51 -0400 Received: by mail-wm1-f66.google.com with SMTP id h4so15775416wmb.4 for <41180 <at> debbugs.gnu.org>; Sun, 10 May 2020 12:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=l26tBP/1uR/JngwBEc2a/dKAIaPeQcq3cZZ1EKp2S2M=; b=KJ6QL3qCq8y1tjbcIZ+4kTTDWBgdq70tWKoVnMLph/yQHzb3EEfJWrQkkYAIbyOz/O bjhH2OHEK+Hr2JfltnZoqx9+QhfR1DWULCykPrE3uNx5Xx6dUnAprQb7hmE+56ER4nOH 7/s736J7XplXC3oMV8QA+3Ms0pHWH8qfdWdho6hd1PFVQzEl8A1Xq7hpG9Zu4HSnqVvU ssROV/bCfGdNmXP1HdIp9qFkqWBkAAz7tiz6fD4eVnxvs0QDXWRyv4BaO6IywYzOQQH1 GA8DsfB6O0Nuq/uEMWIH9ImULYrZnKze5LA4IW+6jeSHjbkgoPKASUXysS527ab78coN shyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=l26tBP/1uR/JngwBEc2a/dKAIaPeQcq3cZZ1EKp2S2M=; b=CHn6W38WBuBtAlouMviMVt1jMslD4sxPx4hunAYVCoL7pUPXHCSpnRGYmJ667HwN31 xq1Cy4e1Zcw2Iod/PHwf22z1fdn7UksaPhvYAvHAjdYnXt3DtSnulaCHTCMJ1HL0EHDc 2VuABh61dxMBjGQi4VMKHzxgpvnV8ij+1WT2YAJP3ED+ZLqcgDYXzrCrYVqwv8lQ2jxq Dx5dwdwVyqgkhkGUGyLkfNFmaf1o0m1Hev36rc7mN1YUXPTkPi7hm3QDp2FZMROOBxbV Yc3FHGIKypnIWKK8hBZJQhK8w4o9mKm7h15iD0PlHJhMvoAzPs0klU1qMvZ5a/Hexg4K GWRg== X-Gm-Message-State: AGi0PuZrJHXDpvKDgg+ctOt7a7QRa47jaKBt+MyoWmHiq6FhVxwDeat2 IngMvty2zMG/Ep/YXeKlbKw= X-Google-Smtp-Source: APiQypLLXNcT4sd6PGleTBE9GcTC8UOTdagZrhj7tCNXaRGCdZBpJcqEY4p9TKgME/QRAxiLPZSnOw== X-Received: by 2002:a1c:e906:: with SMTP id q6mr8252493wmc.62.1589138864359; Sun, 10 May 2020 12:27:44 -0700 (PDT) Received: from guixrules ([2a01:e35:2e0b:a6b0:e2ce:c3ff:fe74:cec8]) by smtp.gmail.com with ESMTPSA id u16sm14228946wrq.17.2020.05.10.12.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 12:27:43 -0700 (PDT) From: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> To: 41180 <at> debbugs.gnu.org Subject: Re: [PATCH] Add cachefilesd service. References: <87v9l3zjg7.fsf@HIDDEN> Date: Sun, 10 May 2020 19:27:42 +0000 In-Reply-To: <87v9l3zjg7.fsf@HIDDEN> (Jean-Baptiste Note's message of "Sun, 10 May 2020 19:19:36 +0000") Message-ID: <87o8qvzj2p.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 41180 Cc: Mathieu Othacehe <m.othacehe@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.5 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Documentation patch. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-doc-Add-documentation-for-cachefilesd-service.patch Content-Transfer-Encoding: quoted-printable From=20b169047ad64996860e6eb154bb4d20ad80463b47 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> Date: Sun, 10 May 2020 18:43:08 +0000 Subject: [PATCH 2/2] doc: Add documentation for cachefilesd-service. * doc/guix.texi (Linux Services): Add a new subsection and document the cachefilesd service and its configuration. =2D-- doc/guix.texi | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 0cba0ee1ec..4aaec43739 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -25724,6 +25724,41 @@ parameters, can be done as follow: @end lisp @end deffn =20 +@cindex cachefilesd +@cindex cachefiles +@cindex fscache +@subsubheading cachefilesd Service + +The cachefilesd service allows one to load start @code{cachefilesd} for +caching network filesystem data on local disks. This is especially +useful for NFS and AFS shares, reducing read latency. + +@deffn {Scheme Variable} cachefilesd-service-type +The service type for starting cachefilesd. For example starting the +cachefiles daemon can be done as follow: + +@lisp +(use-modules (gnu) (gnu services)) +(use-package-modules linux) +(use-service-modules linux) + +(operating-system + ... + (services + (cons* + (service cachefilesd-service-type + (cachefilesd-configuration + (dir "/var/cache/fscache") ; the default value + (syslog? #f) ; don't require syslogd + (secctx "cachefiles_kernel_t") + (tag "mycache") + (brun 10) + (bcull 7) + (bstop 3))) + %base-services))) +@end lisp +@end deffn + @node Miscellaneous Services @subsection Miscellaneous Services =20 =2D-=20 2.26.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEPxcq3dp4FVY5UpckkC0pVsuz75YFAl64Va4ACgkQkC0pVsuz 75YRNg/9FtMmMlfwnaGw8WDWqCr9SXmEF9fUE8pcw5HLitsWSDveoIjbgVRbWbWg Kwe5g+O248FwVrfT3yKznWTWj3Dfa44wpnMswDTulK9rTjTG4OE2Z7DpQd94IVVI Q+x6i2/tKNPxoxNmJE3JdYFUNVo72ocBhygR6+Lb/6Bh3iw3Tx5PYy1xuDFGGVIj KYiwl4NdVVjQ0mW2mjmH/vdjBaU4xZ0fqV4xHzE43m8ypGFY8kaP+Cnx9GB5mw+L n40nlxfordb7txlhSN7QK4rTAMoxFax1wbfVGWiSrqG2vlLy1GJVgZZMSaS9e9tg 096iC+kvF+xbpkRIkbU1rppMX4N6ANIGCchRHjhY1TVk+WXHF5yBB7PxO8pcB6cA 0OkGLVMKe+56g+EVoBcvI/tWGoKcP1fr6z7kYK8qs5QM0321SpbDNbpvgNURVV3p fHHCkK511/pkSTK5I2wNgyp10IkJgD4B90UqVzehiiaGscdMLc3ft5jEQg7ZB+SG WVbw/mWUAtZkluyem8PsTNsrRGfawVYULHwJt60XLrqNopz/zwEUt4fsbTllnG4d /wGx75GD67wCDnd6gjSFc8TDrEZA01Rh0B3mV+DY/w0qft2blCKoB813IVhxd4p4 gCOCUNEKBrbNE063No8nONY484hgT6QefFmHUBktDshogQYxCIA= =w2wH -----END PGP SIGNATURE----- --==-=-=--
guix-patches@HIDDEN
:bug#41180
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 10 May 2020 19:20:04 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 10 15:20:04 2020 Received: from localhost ([127.0.0.1]:50425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jXrUL-0004Gh-MK for submit <at> debbugs.gnu.org; Sun, 10 May 2020 15:20:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:59318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jbnote@HIDDEN>) id 1jXrUK-0004Ga-4Q for submit <at> debbugs.gnu.org; Sun, 10 May 2020 15:19:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <jbnote@HIDDEN>) id 1jXrUJ-0003tu-Tq for guix-patches@HIDDEN; Sun, 10 May 2020 15:19:47 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <jbnote@HIDDEN>) id 1jXrUI-00089q-9a for guix-patches@HIDDEN; Sun, 10 May 2020 15:19:47 -0400 Received: by mail-wr1-x42d.google.com with SMTP id w7so8247989wre.13 for <guix-patches@HIDDEN>; Sun, 10 May 2020 12:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:user-agent:mime-version; bh=bp1Ant0B3dOd4OqziYdhUbhCmJA01A4VvXrJIaAVckw=; b=fjdb4Y3qKP6zkuzkoBXSXXnHwtfeyCB6Vp6j9OKOGFpYlEOHIXohUbmDI5u0K22T7O jSrewT7aBS2C/+YYhtcVqQo/88GsU1A0jZJLbFCA0Wd9jQiGyLVoz/Ph+chzqdpWWUYE wgmXyieweFd6ddQEz7eJrgUoDwLuRBMLOTyn+uBvOJbqA9yyE6/mSFQSP4V2gM7skHqO ldvn6UkWtNZM00fwP2UAqlSVklSHUO30EaZglXQEHyD3Oe/vRc+fj60BoGkUyRz4hFOR QIyXxtNradiA/yu592YR35XUQ++uhzcaU+CQhwQjsRvxF6tBqWZG4lpyTp5YD4dwXUOt Mbiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :user-agent:mime-version; bh=bp1Ant0B3dOd4OqziYdhUbhCmJA01A4VvXrJIaAVckw=; b=OYD6Xlb3VDk+eHTSTK7os3XB/n0Ou2Ekjq62D6QhAo35g8+CloI1wF0w5O0rrJi1BH 4A2SE7SM4wsC2qCQmnSURKuOAlnjGctNroKRYNIMuE/rAXAuEx/0pSxtBQylgTvuZpVe SUrChkTHtwuRdGIwO6oJnF6HpFBdkn3mgWUMNi4pfSzx/cyHrg3sg4sG7MNuBHwoUOMp f12pLjkmWJHpmlKYsR39wjklLU+pHFm84Vs4eB5iicMpQIrBBRGjwJo3+hDlMMvAdXq+ qeV9HPYn5Jo1vP80XKN5GL5EwDMwtRG/Bb4XrFAQtgGhjpAPAoAaxN7sVCYJc4rQm7Oa sMtw== X-Gm-Message-State: AGi0Pub5ez2yGxTHcFv0oVxYv6EsfvDdDvNeKmMD0aR6k2ipoMWZ8ciw 9lZLBq++BKnT0eWIl7CxV2c= X-Google-Smtp-Source: APiQypJPNY7espjIHSpKOlgud47x9Ulo8GGj9PxrvByXrrCevmGYkmlFr+pOoYs1IYkUYChXtRyqEQ== X-Received: by 2002:adf:cc81:: with SMTP id p1mr14119991wrj.192.1589138384181; Sun, 10 May 2020 12:19:44 -0700 (PDT) Received: from guixrules ([2a01:e35:2e0b:a6b0:e2ce:c3ff:fe74:cec8]) by smtp.gmail.com with ESMTPSA id u16sm14201275wrq.17.2020.05.10.12.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 12:19:42 -0700 (PDT) From: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> To: guixpatch <guix-patches@HIDDEN> Subject: [PATCH] Add cachefilesd service. Date: Sun, 10 May 2020 19:19:36 +0000 Message-ID: <87v9l3zjg7.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=jbnote@HIDDEN; helo=mail-wr1-x42d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Dear guix developers, Mathieu, Please find attached a first version of the cachefilesd service patch. The second patch for documentation will be sent right after. I have a few general newbie scheme questions: Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: m4x.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jbnote[at]gmail.com) -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 1.9 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit Cc: Mathieu Othacehe <m.othacehe@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.5 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Dear guix developers, Mathieu, Please find attached a first version of the cachefilesd service patch. The second patch for documentation will be sent right after. I have a few general newbie scheme questions: - I gathered that #~ / #$ kinds of suspends evaluation / forces it -- is there documentation about this somewhere ? - There's something that looks like a splat operator (only seen in conjuction with forcing evaluation in #$@) -- again i'd be interested in more documentation about this feature -- is this a guix-specific operator? - I don't understand why there are ^L separating services in the scheme files -- is this necessary? A convention? What purpose does it serve? Regarding the patch itself: - i'm not entirely sure the service belongs to services/linux.scm - documentation is hastily written. I have found no way to indent automatically the lisp code in the texi file, which is very painfull -- would there be an emacs solution for this? - there are no automated tests (beyond what I have done by hand locally!), and there's no lint, so I don't really feel confident about it :) Are there tests for services to alleviate my fears? - I've copied some other service for modprobing the required kernel modules before launching the daemon with a one-shot shepherd service. Frankly i'm not happy about this solution, it seems to me that it unnecessarily pollutes the shepherd configuration; maybe some other mechanism (graft?) adjusting the modprobe configuration could be better (better still, autoload the file). Any guidance would be nice (including, that this solution is sufficient for now :)) I had great fun writing this, it reminded me of writing cookbooks during my 'Chef' days. I must confess that the Chef DSL embedded in ruby seemed more concise, and that it provided a way to write a cookbook 'out-of-tree' which was kind of less daunting for newcomers; however it's already amazing that you have this kind of functionality! Kind regards, Jean-Baptiste --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-Add-cachefilesd-service.patch Content-Transfer-Encoding: quoted-printable From=20729d43d541e8dcb41b36a7522ec291b0c3f8dd14 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Note <jean-baptiste.note@HIDDEN> Date: Sat, 9 May 2020 15:14:26 +0000 Subject: [PATCH 1/2] gnu: Add cachefilesd-service. * doc/guix.texi (Linux Services): Add a new subsection and document the new service and its configuration. * gnu/services/linux.scm (cachefilesd-service-type): New type. (cachefilesd-configuration): New type. =2D-- gnu/services/linux.scm | 210 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 209 insertions(+), 1 deletion(-) diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm index 12934c2084..810901e0ca 100644 =2D-- a/gnu/services/linux.scm +++ b/gnu/services/linux.scm @@ -42,7 +42,11 @@ earlyoom-configuration-send-notification-command earlyoom-service-type =20 =2D kernel-module-loader-service-type)) + kernel-module-loader-service-type + + cachefilesd-configuration + cachefilesd-configuration? + cachefilesd-service-type)) =20 ;;; @@ -177,3 +181,207 @@ representation." (compose concatenate) (extend append) (default-value '()))) + + +;;; +;;; cachefilesd. +;;; + +(define-record-type* <cachefilesd-configuration> + cachefilesd-configuration make-cachefilesd-configuration + cachefilesd-configuration? + + ;; <package-path> + (cachefilesd cachefilesd-configuration-cachefilesd + (default cachefilesd)) + + ;; cmdline flags + ;; Boolean + (daemonic? cachefilesd-configuration-daemonic? + (default #t)) + + ;; string + (pid-file cachefilesd-configuration-pid-file + (default "/var/run/cachefilesd.pid")) + + ;; Boolean + (debug? cachefilesd-configuration-debug? + (default #f)) + ;; Boolean + (syslog? cachefilesd-configuration-syslog? + (default #t)) + ;; Boolean + (culling-and-scanning? cachefilesd-configuration-culling-and-scanning? + (default #t)) + + ;; configuration file contents + ;; String + (dir cachefilesd-configuration-dir + (default "/var/cache/fscache")) + + ;; String + (tag cachefilesd-configuration-tag + (default "CacheFiles")) + + ;; String + (secctx cachefilesd-configuration-secctx + (default #f)) + + ;; integers + (brun cachefilesd-configuration-brun + (default 7)) + (frun cachefilesd-configuration-frun + (default 7)) + (bcull cachefilesd-configuration-bcull + (default 5)) + (fcull cachefilesd-configuration-fcull + (default 5)) + (bstop cachefilesd-configuration-bstop + (default 1)) + (fstop cachefilesd-configuration-fstop + (default 1)) + + ;; integer + (culltable cachefilesd-configuration-culltable + (default 12)) + + ;; integer / debug mask + (kernel-debug cachefilesd-configuration-kernel-debug + (default 0)) + + ;; boolean + (nocull? cachefilesd-configuration-nocull? + (default #f)) + ;; Boolean + ;; XXX: This should really be handled in an orthogonal way, for instance= as + ;; proposed in <https://bugs.gnu.org/27155>. Keep it internal/undocumen= ted + ;; for now. + (%auto-start? cachefilesd-auto-start? + (default #t))) + +(define (cachefilesd-configuration-file config) + "Return the cachefilesd configuration file corresponding to CONFIG." + (define secctx + (cachefilesd-configuration-dir config)) + + (computed-file + "cachefilesd.conf" + #~(begin + (use-modules (ice-9 match)) + (call-with-output-file #$output + (lambda (port) + (display "# Generated by 'cachefilesd-service'.\n" port) + (format port "dir ~a\n" #$(cachefilesd-configuration-dir config= )) + + (let ((secctx #$(cachefilesd-configuration-secctx config))) + (if secctx (format port "secctx ~a" secctx))) + + ;; XXX factor this + (format port "brun ~a%\n" + #$(number->string + (cachefilesd-configuration-brun config))) + (format port "frun ~a%\n" + #$(number->string + (cachefilesd-configuration-frun config))) + (format port "bcull ~a%\n" + #$(number->string + (cachefilesd-configuration-bcull config))) + (format port "fcull ~a%\n" + #$(number->string + (cachefilesd-configuration-fcull config))) + (format port "bstop ~a%\n" + #$(number->string + (cachefilesd-configuration-bstop config))) + (format port "fstop ~a%\n" + #$(number->string + (cachefilesd-configuration-fstop config))) + + (format port "tag ~a\n" #$(cachefilesd-configuration-tag config= )) + + (format port "culltable ~a\n" + #$(number->string + (cachefilesd-configuration-culltable config))) + + (if #$(cachefilesd-configuration-nocull? config) + (display "nocull\n" port)) + + (format port "debug ~a\n" + #$(number->string + (cachefilesd-configuration-kernel-debug config))) + + #t))))) + +(define (cachefilesd-activation config) + "Return cachefilesd's activation GEXP for CONFIG." + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + ;; Make sure the cache directory and pid dir exists + (mkdir-p #$(cachefilesd-configuration-dir config)) + (mkdir-p (dirname #$(cachefilesd-configuration-pid-file config))))= )) + +(define (cachefilesd-shepherd-service config) + "Return a <shepherd-service> for cachefilesd with CONFIG." + + (define cachefilesdpath + (cachefilesd-configuration-cachefilesd config)) + (define pid-file + (cachefilesd-configuration-pid-file config)) + (define syslog? + (cachefilesd-configuration-syslog? config)) + (define culling-and-scanning? + (cachefilesd-configuration-culling-and-scanning? config)) + (define debug? + (cachefilesd-configuration-debug? config)) + + (define cachefilesd-command + #~(list #$(file-append cachefilesdpath "/sbin/cachefilesd") + #$@(if (cachefilesd-configuration-daemonic? config) '() '("-n"= )) + ;; XXX shepherd pid file handling: no idea how shepherd does it + ;; and if it's going to conflict with cachefilesd's + #$@(if debug? '("-d") '()) + #$@(if syslog? '() '("-s")) + #$@(if culling-and-scanning? '() '("-N")) + "-p" #$pid-file + "-f" #$(cachefilesd-configuration-file config))) + + (list (shepherd-service + (documentation "Start cachefilesd daemon.") + (requirement (append '(file-systems cachefiles-module) + (if syslog? '(syslogd) '()))) + (provision '(cachefilesd)) + (start #~(make-forkexec-constructor #$cachefilesd-command + #:pid-file #$pid-file)) + (stop #~(make-kill-destructor)) + (auto-start? (cachefilesd-auto-start? config))) + + (shepherd-service + (provision '(cachefiles-module)) + (requirement '(file-systems)) + (modules '((guix build utils))) + (documentation + "Load the cachefiles Linux kernel module.") + (start (with-imported-modules '((guix build utils)) + #~(lambda _ + ;; XXX: duplicated from networking + ;; -- factor this into a modprobe command + ;; XXX: We can't use 'load-linux-module*' here becau= se it + ;; expects a flat module directory. + (setenv "LINUX_MODULE_DIRECTORY" + "/run/booted-system/kernel/lib/modules") + (invoke #$(file-append kmod "/bin/modprobe") + "cachefiles")))) + (one-shot? #t)))) + +(define cachefilesd-service-type + (service-type (name 'cachefilesd) + (description + "Run the CacheFile backend daemon, @command{cachefilesd}.= ") + (extensions + (list + (service-extension shepherd-root-service-type + cachefilesd-shepherd-service) + (service-extension activation-service-type + cachefilesd-activation))) + (compose concatenate) + (default-value (cachefilesd-configuration)))) =2D-=20 2.26.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEPxcq3dp4FVY5UpckkC0pVsuz75YFAl64U8gACgkQkC0pVsuz 75bJ4RAAoUmmXPdAGW3uD5W/YO8U8A1FhUr/qoq+1qkClSDv0Jt/qyKRca7hYrdZ C0JAgfYGmdk/Qy0ltnRACR96pcZP4YUf5NWjTKNPQykOjucJISXsSUTSojljZHbT c4ei7KjNMU0jRrrKZFqR4IlsVLYy1K4wFQfU4yLH9sU2ZgUd4R+Mb6eM1F7zWYog qSHTp3+ZgAVB5BaZ9pDlDdsOAKU8WO5oy8in/GEFREoL5vjeBiueqLMSYI/epPWn N94j96cM3I/sL/FaBs6Ib5cGvXox8TW54BoOx2HBTZMoo4iZkhDnSnFro8cZYa66 IeDta1xzfusDMmQibvMiw2w3D3w/mgLz+X5HO7kPTQrbg5XlK2kMdeiO6oUH5cw7 GA7ooB4MTIivZZeyqynXieUvcS2lIQ/1TS8TU6wgGNymUsrmym08+Y06Qtc9lyZh nsIeFCmNEMqIXb/wIIjRgWtIX6movMmRNTCq7fBCXeTu50IvING1PNZsrToHN1qA V9g49CBByBhVbEa661bldRwfVJgINoigI23BBzTZe0omabNym9RKdayAHdP099yY zwC1e9KUUAK8UXU1X272lRjCElJy0+h5q++KVMdhiC8502nE2IJeLH1V2hZZOXkC cywDxV5BhxISME24RFAXCrJxFUqdViZ3cU3dL1lmKDg+NPk7pzQ= =sR04 -----END PGP SIGNATURE----- --==-=-=--
Jean-Baptiste Note <jean-baptiste.note@HIDDEN>
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#41180
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.