From unknown Thu Jun 19 14:29:11 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58086] [PATCH] gnu: Add fstrim-service-type. Resent-From: iyzsong@envs.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Sep 2022 07:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58086 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58086@debbugs.gnu.org Cc: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166417732431823 (code B ref -1); Mon, 26 Sep 2022 07:29:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Sep 2022 07:28:44 +0000 Received: from localhost ([127.0.0.1]:49137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ociXk-0008HD-Bj for submit@debbugs.gnu.org; Mon, 26 Sep 2022 03:28:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:44722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ociXh-0008H3-EN for submit@debbugs.gnu.org; Mon, 26 Sep 2022 03:28:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ociXh-00023o-8j for guix-patches@gnu.org; Mon, 26 Sep 2022 03:28:41 -0400 Received: from mail.envs.net ([5.199.136.28]:36160) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ociXf-00063j-9D for guix-patches@gnu.org; Mon, 26 Sep 2022 03:28:40 -0400 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 9384938A0FAF; Mon, 26 Sep 2022 07:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1664177307; bh=9/+nvn8WChAUUV+3J7HnA2dmlJjtknS7GG63KUWr3Y4=; h=From:To:Cc:Subject:Date:From; b=p0OOb0EMde0lm0sroadJDxsHWtZjD7x/xbFjEjrYCIq0oh3TZcoVftEzKWd8Hc8EV td3kVvUn7BUhhBdqHmDiUf61qPC5E9t8ceVZpGNX2/NElLOzT2H9bYf88C6Y+O9FbN n4Fh9yv/Ct8IcZZFx+NfU0Z/PfH2xMAKt0oXtZG7131nhQxYeb1LrwYPhqhwxE+X+w Y/1K4dSVX1GWNiaGM6TR1USWXa0OBBfXDwhHWI+HHaUN3gKANAkf492Yoi7ntK/7h9 MAsUyAvsljp9/zIZQc8Wb72Rec8yhPR8bqzKo03XOj5hCoLRorz4ThuH89YQwsWAft 6sgLlVo/KkdnHfr7N1BaIlM8C3d15f1e1nqdJwiwzpcE0s9Ob/Nr4L10sSyfOJh/V1 oT+SnlY3TbUlsZCw1vYUyxdmXwvjvb/oTHWuXPfGQOKza9hrxzTLOtf8uOzeKi0Gbz RtRGRAu4o76CxT0y64R3ZX4VOThxvMMvTY8Q+WWJeblyJ8wHHv49KA5jZccDqFdLUz tI5f1X4VAkcbI0R33ClhqGlUjcmg22qX301k9eptQ3CQ6y762KzwI9Sjb60Rq8416y F9hFpX+5x6nNfveQ3sH4ZHiL5k4+qCuZlS0WoXlElaBmRaxiqXBSPFnHFFnL6Bkzed 6000qHgu3rIYeYBJeGlhW4fY= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2kjrR0VJni_Q; Mon, 26 Sep 2022 07:28:24 +0000 (UTC) Received: from localhost (unknown [182.150.116.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Mon, 26 Sep 2022 07:28:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id efc52026; Mon, 26 Sep 2022 07:28:27 +0000 (UTC) From: iyzsong@envs.net Date: Mon, 26 Sep 2022 15:28:25 +0800 Message-Id: <20220926072825.4689-1-iyzsong@envs.net> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=5.199.136.28; envelope-from=iyzsong@envs.net; helo=mail.envs.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) From: 宋文武 A timestamp file "/var/lib/mcron/fstrim.stamp" is used to ensure we will catch up on missed job runs when the system was powered down. * gnu/services/mcron.scm (%mcron-activation): New extension to create '/var/lib/mcron'. * gnu/services/admin.scm (fstrim-configuration): New record type. (fstrim-mcron-jobs): New procedure. (fstrim-service-type): New service type. --- gnu/services/admin.scm | 56 +++++++++++++++++++++++++++++++++++++++++- gnu/services/mcron.scm | 8 ++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 252bedb0bd..2b22fc5b33 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -21,6 +21,7 @@ (define-module (gnu services admin) #:use-module (gnu packages admin) #:use-module (gnu packages certs) + #:use-module (gnu packages linux) #:use-module (gnu packages package-management) #:use-module (gnu services) #:use-module (gnu services mcron) @@ -30,6 +31,7 @@ (define-module (gnu services admin) #:use-module (guix packages) #:use-module (guix records) #:use-module (srfi srfi-1) + #:use-module (ice-9 match) #:use-module (ice-9 vlist) #:export (%default-rotations %rotated-files @@ -63,7 +65,11 @@ (define-module (gnu services admin) unattended-upgrade-configuration-services-to-restart unattended-upgrade-configuration-system-expiration unattended-upgrade-configuration-maximum-duration - unattended-upgrade-configuration-log-file)) + unattended-upgrade-configuration-log-file + + fstrim-service-type + fstrim-configuration + fstrim-configuration?)) ;;; Commentary: ;;; @@ -376,4 +382,52 @@ (define unattended-upgrade-service-type "Periodically upgrade the system from the current configuration.") (default-value (unattended-upgrade-configuration)))) + +;;; +;;; fstrim. +;;; + +(define-record-type* + fstrim-configuration make-fstrim-configuration fstrim-configuration? + (command fstrim-configuration-command + (default + (list (file-append util-linux "/sbin/fstrim") + "--verbose" "--quiet-unsupported" + "--listed-in" "/etc/fstab"))) + (interval fstrim-configuration-interval (default (* 60 60 24 7)))) ; weekly + +;;; By storing the time of job's last run in a file, we can catch up on missed +;;; runs when the system was powered down. +(define fstrim-mcron-stamp "/var/lib/mcron/fstrim.stamp") + +(define fstrim-mcron-jobs + (match-lambda + (($ command interval) + (list + #~(job + (let ((last-time + (catch #t + (lambda () + (with-input-from-file #$fstrim-mcron-stamp read)) + ;; We schedule a first run immediately. + (const 0)))) + (lambda (current-time) + (let ((next-time (max current-time (+ #$interval last-time)))) + (set! last-time next-time) + next-time))) + (lambda () + (apply system* '#$command) + (with-output-to-file #$fstrim-mcron-stamp + (lambda () (write (current-time)))))))))) + +(define fstrim-service-type + (service-type + (name 'fstrim) + (extensions + (list (service-extension mcron-service-type + fstrim-mcron-jobs))) + (description + "Periodically discard unused blocks on filesystems.") + (default-value (fstrim-configuration)))) + ;;; admin.scm ends here diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm index 23760ebda4..833d979ab4 100644 --- a/gnu/services/mcron.scm +++ b/gnu/services/mcron.scm @@ -154,6 +154,12 @@ (define mcron-shepherd-services (actions (list (shepherd-schedule-action mcron files))))))))) +(define %mcron-activation + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/lib/mcron")))) + (define mcron-service-type (service-type (name 'mcron) (description @@ -161,6 +167,8 @@ (define mcron-service-type (extensions (list (service-extension shepherd-root-service-type mcron-shepherd-services) + (service-extension activation-service-type + (const %mcron-activation)) (service-extension profile-service-type (compose list mcron-configuration-mcron)))) -- 2.37.3 From unknown Thu Jun 19 14:29:11 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58086] [PATCH] gnu: Add fstrim-service-type. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Oct 2022 21:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58086 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: iyzsong@envs.net Cc: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= , 58086@debbugs.gnu.org Received: via spool by 58086-submit@debbugs.gnu.org id=B58086.166509002420571 (code B ref 58086); Thu, 06 Oct 2022 21:01:02 +0000 Received: (at 58086) by debbugs.gnu.org; 6 Oct 2022 21:00:24 +0000 Received: from localhost ([127.0.0.1]:33655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogXyh-0005Lj-N2 for submit@debbugs.gnu.org; Thu, 06 Oct 2022 17:00:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogXyb-0005LQ-Qw for 58086@debbugs.gnu.org; Thu, 06 Oct 2022 17:00:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogXyV-0001b8-Ns; Thu, 06 Oct 2022 17:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=n5a+n3bvghe6R4u4WwEVb/3FK5BW+Ew4yefy5D4Siqw=; b=F5G8fWwDGnYI78LTBwDp 7gqQjNrwkwTujNxQL6arQkVnrs6s/dHgD0IuCB4EjmbUZGjUD7UbuWIhaDD4RUXixE+azv8TPCjDZ cHN4o5zInd7te7WtfOsqGONXL5tYWW+0pMrdj2n455yJ1GF5Jfp/d2WKfewCRKOnjRZ/Xc5zr5YGY wgHLcLf79bj6FhB1iSrHiG7AYMZM6jPLufEyKw9vow9cvHT4X1hRIAQOjMbg09DYouPZWKyHrm636 C5ruzAKnVnH3DDD28KHCS7kzc0lkWAEFKO6A4T4ES6YCFRmXcVWSFHomZHRxGyaHTx3BqzP1RXJ7B cn0tsCFwsg452w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:59648 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogXyV-0006Xn-4N; Thu, 06 Oct 2022 17:00:11 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220926072825.4689-1-iyzsong@envs.net> Date: Thu, 06 Oct 2022 23:00:08 +0200 In-Reply-To: <20220926072825.4689-1-iyzsong@envs.net> (iyzsong@envs.net's message of "Mon, 26 Sep 2022 15:28:25 +0800") Message-ID: <87a668hdlz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, iyzsong@envs.net skribis: > From: =E5=AE=8B=E6=96=87=E6=AD=A6 > > A timestamp file "/var/lib/mcron/fstrim.stamp" is used to ensure we will > catch up on missed job runs when the system was powered down. > > * gnu/services/mcron.scm (%mcron-activation): New extension to create > '/var/lib/mcron'. > * gnu/services/admin.scm (fstrim-configuration): New record type. > (fstrim-mcron-jobs): New procedure. > (fstrim-service-type): New service type. Please add documentation in doc/guix.texi. :-) [...] > +(define fstrim-mcron-jobs > + (match-lambda > + (($ command interval) > + (list > + #~(job > + (let ((last-time > + (catch #t > + (lambda () > + (with-input-from-file #$fstrim-mcron-stamp read)) > + ;; We schedule a first run immediately. > + (const 0)))) > + (lambda (current-time) > + (let ((next-time (max current-time (+ #$interval last-time)= ))) > + (set! last-time next-time) > + next-time))) > + (lambda () > + (apply system* '#$command) > + (with-output-to-file #$fstrim-mcron-stamp > + (lambda () (write (current-time)))))))))) That seems a little bit complicated, no? That=E2=80=99s because you want to make sure it runs immediately at boot if it never ran before, right? Is that important? > +(define fstrim-service-type > + (service-type > + (name 'fstrim) > + (extensions > + (list (service-extension mcron-service-type > + fstrim-mcron-jobs))) > + (description > + "Periodically discard unused blocks on filesystems.") =E2=80=9Cfile systems=E2=80=9D, two words. Perhaps add a few more words me= ntioning the fstrim package? > +++ b/gnu/services/mcron.scm > @@ -154,6 +154,12 @@ (define mcron-shepherd-services > (actions > (list (shepherd-schedule-action mcron files))))))))) >=20=20 > +(define %mcron-activation > + (with-imported-modules '((guix build utils)) > + #~(begin > + (use-modules (guix build utils)) > + (mkdir-p "/var/lib/mcron")))) I=E2=80=99m not sure the fstrim timestamp should leave in a directory that = looks as if it was =E2=80=9Cowned=E2=80=9D by mcron. Could you send an updated patch? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 03 11:44:37 2022 Received: (at control) by debbugs.gnu.org; 3 Nov 2022 15:44:37 +0000 Received: from localhost ([127.0.0.1]:50025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqcOT-0003sB-58 for submit@debbugs.gnu.org; Thu, 03 Nov 2022 11:44:37 -0400 Received: from mira.cbaines.net ([212.71.252.8]:41656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqcOR-0003s1-Hr for control@debbugs.gnu.org; Thu, 03 Nov 2022 11:44:35 -0400 Received: from localhost (93-63-133-243.ip27.fastwebnet.it [93.63.133.243]) by mira.cbaines.net (Postfix) with ESMTPSA id 8D39327BBE9 for ; Thu, 3 Nov 2022 15:44:34 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 53036651 for ; Thu, 3 Nov 2022 15:44:32 +0000 (UTC) From: Christopher Baines To: control@debbugs.gnu.org Subject: tag 58086 moreinfo Date: Thu, 03 Nov 2022 15:44:32 +0000 Message-ID: <87a658qbz3.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 58086 + moreinfo quit From unknown Thu Jun 19 14:29:11 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58086] [PATCH] gnu: Add fstrim-service-type. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Mar 2023 12:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58086 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: iyzsong@envs.net Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 58086@debbugs.gnu.org, Maxim Cournoyer Received: via spool by 58086-submit@debbugs.gnu.org id=B58086.167948663629368 (code B ref 58086); Wed, 22 Mar 2023 12:04:02 +0000 Received: (at 58086) by debbugs.gnu.org; 22 Mar 2023 12:03:56 +0000 Received: from localhost ([127.0.0.1]:33706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pexC8-0007db-Dm for submit@debbugs.gnu.org; Wed, 22 Mar 2023 08:03:56 -0400 Received: from smtpm2.myservices.hosting ([185.26.105.233]:34810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pexC7-0007dU-2k for 58086@debbugs.gnu.org; Wed, 22 Mar 2023 08:03:55 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm2.myservices.hosting (Postfix) with ESMTP id 7068920F38; Wed, 22 Mar 2023 13:03:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 2775D800A3; Wed, 22 Mar 2023 13:03:50 +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 0LZ-bNZ6mPMW; Wed, 22 Mar 2023 13:03:49 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id BD0CB800A1; Wed, 22 Mar 2023 13:03:48 +0100 (CET) Message-ID: <1a1991d3-afc0-4e2b-50a4-dfad763907f7@makinata.eu> Date: Wed, 22 Mar 2023 12:03:44 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US References: <20220926072825.4689-1-iyzsong@envs.net> From: Bruno Victal In-Reply-To: <20220926072825.4689-1-iyzsong@envs.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hi 宋文武, I didn't notice this patch and ended up reimplementing another fstrim-service-type at [1]. Where we differ in the implementations: * I didn't attempt to implement anacron capabilities, since I made the scheduling configurable. * Uses define-configuration which can embed documentation and generate it for the manual. * Slightly more “guix-y” style of configuration. [1]: Apologies for the duplicated effort! Cheers, Bruno From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 22 10:09:00 2023 Received: (at control) by debbugs.gnu.org; 22 Mar 2023 14:09:00 +0000 Received: from localhost ([127.0.0.1]:36212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pez9A-0007wM-4c for submit@debbugs.gnu.org; Wed, 22 Mar 2023 10:09:00 -0400 Received: from mail-qv1-f44.google.com ([209.85.219.44]:42594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pez97-0007wA-Vn for control@debbugs.gnu.org; Wed, 22 Mar 2023 10:08:58 -0400 Received: by mail-qv1-f44.google.com with SMTP id x8so12196770qvr.9 for ; Wed, 22 Mar 2023 07:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679494132; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=cdNQE8gF7nxY1Sh1kNSg5XliRJh9fONbWmL8tpWK9og=; b=EucAQLs98/QLx+/gd4XaM8KH5HzIKZuivWsfGoExHqdAWZ6gBY4jl08v/oBsQV+4nw QYZ3uynmXLWWmF0R0uq4lxXWuxDuRtVMkHE1n6ft781PtnivOY+owSspJkBcUK9FZKnK 90Yb9w9KqKVZyzbIB1R1PFPStMGPRQowYcWkrdRWvlTFXDendmNcGDQql3f1hpeMNfzm H6yhfQWfXvkNUvhyTbhRTXAG7wF6ZJM5ns81vyklg/tboSSf0kCNDvuzEcAsFcMiA8kO eL9krFGNwci4+rdbSRwwQexRfdrivC4TxE8uNXlKCBJqMyLrh6Qo7+KgvjDdG3H/O/7z 3s1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679494132; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cdNQE8gF7nxY1Sh1kNSg5XliRJh9fONbWmL8tpWK9og=; b=Y/JwDnL7vIk0LV2nmj3tPfzbcE/TEJYUu0fxzH2yUf++G+CNAoYUxG0SO+iQH4EfGp D01FOFAqv+g2igxG7x68YjmSTLyiqwiYidP0x4pggDdUz+DjRsJkM15nxYMyI8dOOTzd DkDaWXV8yRcxooncXo7OPRsPiNj2SGWZ1EjSkJmoWrBVxPQGRH8NU3s8HqmVtHijvVWh TbBgVzsPxhBRi9yN9dR/2nefLgWRDLb/uWfl7l/VWV4LJK354d0kTyOolN+oKJT/oldV bW9iNCZD8lriQfh6e1nkFtbgMAeWT/kDu/z19Ktoa95oDEs0xHvIXnSuqU56cCUKwrXt 4gTA== X-Gm-Message-State: AO0yUKX8jnQc+evcQF44LR3uSW/BSqnxC5JarNT0gImRrBpSZVuVjG6Z bgDWeVW5TzfOncUh9JkMbrI9WaR1RvHZGQ== X-Google-Smtp-Source: AK7set+AI/Y5yINQ8Jy/TG9UoTbMkQ5dkztGjQ62dXpcLU6d8/uxFIQMNZ5j22eVLX4/RxRtWe8ErQ== X-Received: by 2002:a05:6214:194d:b0:56c:376:3191 with SMTP id q13-20020a056214194d00b0056c03763191mr6287062qvk.44.1679494132175; Wed, 22 Mar 2023 07:08:52 -0700 (PDT) Received: from hurd (dsl-10-130-195.b2b2c.ca. [72.10.130.195]) by smtp.gmail.com with ESMTPSA id 141-20020a370793000000b0074672975d5csm7084107qkh.91.2023.03.22.07.08.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 07:08:51 -0700 (PDT) Date: Wed, 22 Mar 2023 10:08:50 -0400 Message-Id: <875yasj2tp.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #58086 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) merge 58086 61964 quit From unknown Thu Jun 19 14:29:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: iyzsong@envs.net Subject: bug#58086: closed (Re: bug#61964: [PATCH] services: Add fstrim-service-type.) Message-ID: References: <874jqcj2mo.fsf_-_@gmail.com> <20220926072825.4689-1-iyzsong@envs.net> X-Gnu-PR-Message: they-closed 58086 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch moreinfo Reply-To: 58086@debbugs.gnu.org Date: Wed, 22 Mar 2023 14:14:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1679494442-31224-1" This is a multi-part message in MIME format... ------------=_1679494442-31224-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #58086: [PATCH] gnu: Add fstrim-service-type. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 58086@debbugs.gnu.org. --=20 58086: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D58086 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1679494442-31224-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 58086-done) by debbugs.gnu.org; 22 Mar 2023 14:13:12 +0000 Received: from localhost ([127.0.0.1]:36238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pezDD-00085i-Tb for submit@debbugs.gnu.org; Wed, 22 Mar 2023 10:13:12 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:46981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pezDC-00085S-CN; Wed, 22 Mar 2023 10:13:11 -0400 Received: by mail-qt1-f181.google.com with SMTP id c19so22696320qtn.13; Wed, 22 Mar 2023 07:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679494384; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=zmW7UCXZKNr8xskYaS8Wc9v5Bg8vnCPXA01QWkpvMOs=; b=DXKWlEWe8dkzLzDZgwvz5zIySJPJY77Wu8VbbVeM2dMXj5w8dV6gYKFIxIUZM2jleG W1iYkHXh6+yYy0UG7/EcseDCejdJe2OVQSQjsWBu9Hy3inrKkxsXCV45PI78yAvWAKfO sbgUOcCICWir6lDX7GskmSxAxgj8eq1x3CyhNtUdkVoqnCEgLcnnVMrEw9+NKpCBp/sl ksMcMtx+W4e8o8dkWbu6sqKFFIh9FSlZpCpvX2dKslkf3QEz/FO4Ngs8wHak6u6dFFgh ivEMXSj0Wi7B4iLPEV140gv5j0LkwjdYaZEyXUpyYrupaQ1G5x/iUpkHOvEYxWgbxYwp ekMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679494384; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zmW7UCXZKNr8xskYaS8Wc9v5Bg8vnCPXA01QWkpvMOs=; b=N/nA5ZJBVKOxJgWXK1qql7Upx60FzU4YgCWfdxgys7k9PUYTE7yYaWBPKuxME/XjQG a1qEw9MwiwA9MjDe+3UH3UXw2Lime1lolhStiCH/oNPr5o0FcGcKjCrznX29BAJAITTN Akma1BjHQpNvVB2HFIXPnmoV2QNxNs9nNI5dLS7sOB61N2dzHj1KnB7HqrNT8aVAlENL fBbHpVIZ7XCSgVhtP5rTbfyRKQLEuB3vQ3rmrnYSsNvGFiPub+t2sER5KUoj232+GNDQ bNG5FRD0VkRIm5s6yqIuN0YqOXRqohCnNI8uQgt40u1IOd6NSsziCJIBJlGrj71pGSNd PqLQ== X-Gm-Message-State: AO0yUKV/+bR9Ml8vOkr5GhKLpe6O1IC/ifh7GzTkQRXPk4lVP3/PXtkK qgv2SbE3vhOG+J3jvcRjf9SZpTpIMXZxYQ== X-Google-Smtp-Source: AK7set8vnO1FFYHNfGlTdK5KXT5luQxNG7+BxN0ZhOol/rDV1k4L4GMCuvPBrwAaHVawXGAeI4vABQ== X-Received: by 2002:ac8:5b4e:0:b0:3e0:8c58:1dd with SMTP id n14-20020ac85b4e000000b003e08c5801ddmr5518613qtw.55.1679494384475; Wed, 22 Mar 2023 07:13:04 -0700 (PDT) Received: from hurd (dsl-10-130-195.b2b2c.ca. [72.10.130.195]) by smtp.gmail.com with ESMTPSA id e1-20020ac84901000000b003d460ec242esm10168532qtq.81.2023.03.22.07.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 07:13:04 -0700 (PDT) From: Maxim Cournoyer To: Bruno Victal Subject: Re: bug#61964: [PATCH] services: Add fstrim-service-type. References: <9fec722b58c87211f019fa702a5c7047577bec64.1677952942.git.mirai@makinata.eu> <2be8cc336a7e56ee6c15a57548c3b7690803101f.1679485589.git.mirai@makinata.eu> Date: Wed, 22 Mar 2023 10:13:03 -0400 In-Reply-To: <2be8cc336a7e56ee6c15a57548c3b7690803101f.1679485589.git.mirai@makinata.eu> (Bruno Victal's message of "Wed, 22 Mar 2023 11:47:19 +0000") Message-ID: <874jqcj2mo.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58086-done Cc: 61964-done@debbugs.gnu.org, 58086-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Bruno Victal writes: > * gnu/services/linux.scm (fstrim-service-type): New variable. > (fstrim-mcron-job, serialize-fstrim-configuration) > (fstrim-serialize-list-of-strings, fstrim-serialize-boolean): New procedure. > (mcron-time?): New predicate. > (fstrim-configuration): New record. > * doc/guix.texi (Linux Services): Document new fstrim-service-type. I've installed the change, with the following mostly cosmetic adjustments: --8<---------------cut here---------------start------------->8--- modified doc/guix.texi @@ -37493,7 +37493,7 @@ notifications. The command @command{fstrim} can be used to discard (or @dfn{trim}) unused blocks on a mounted file system. -@c This was copied from the fstrim manpage, with some texinfo touch-ups. +@c This was copied from the fstrim manpage, with some Texinfo touch-ups. @quotation Warning Running @command{fstrim} frequently, or even using @command{mount -o discard}, might negatively affect the lifetime of @@ -37540,8 +37540,8 @@ Verbose execution. Suppress error messages if trim operation (ioctl) is unsupported. @item @code{extra-arguments} (type: maybe-list-of-strings) -Extra options to append to @command{fstrim} command.@footnote{Run -@samp{man fstrim} for more information.} +Extra options to append to @command{fstrim} (run @samp{man fstrim} for +more information). @end table @end deftp modified gnu/services/linux.scm @@ -185,10 +185,9 @@ (define (fstrim-serialize-list-of-strings field-name value) (define-configuration fstrim-configuration (package - (file-like util-linux) - "The package providing the @command{fstrim} command." - empty-serializer) - + (file-like util-linux) + "The package providing the @command{fstrim} command." + empty-serializer) (schedule (mcron-time "0 0 * * 0") "Schedule for launching @command{fstrim}. This can be a procedure, a list @@ -196,8 +195,7 @@ (define-configuration fstrim-configuration Job specification, mcron, the mcron manual}. By default this is set to run weekly on Sunday at 00:00." empty-serializer) - - ;; fstrim options + ;; The following are fstrim-related options. (listed-in (maybe-list-of-strings '("/etc/fstab" "/proc/self/mountinfo")) ;; Note: documentation sourced from the fstrim manpage. @@ -205,27 +203,19 @@ (define-configuration fstrim-configuration empty files are silently ignored. The evaluation of the list @emph{stops} after the first non-empty file. File systems with @code{X-fstrim.notrim} mount option in fstab are skipped.") - (verbose? (boolean #t) "Verbose execution.") - (quiet-unsupported? (boolean #t) "Suppress error messages if trim operation (ioctl) is unsupported.") - (extra-arguments maybe-list-of-strings - ;; Tracked at: . - ;; FIXME@GUILE(TEXINFO): @footnote causes errors when calling - ;; configuration->documentation. - ;; > Throw to key `parser-error' with args `(#f "Unknown command" footnote)' - "Extra options to append to @command{fstrim} command.@footnote{Run -@samp{man fstrim} for more information.}" + "Extra options to append to @command{fstrim} (run @samp{man fstrim} for +more information)." (lambda (_ value) (if (maybe-value-set? value) value '()))) - (prefix fstrim-)) (define (serialize-fstrim-configuration config) --8<---------------cut here---------------end--------------->8--- Thank you! -- Maxim ------------=_1679494442-31224-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Sep 2022 07:28:44 +0000 Received: from localhost ([127.0.0.1]:49137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ociXk-0008HD-Bj for submit@debbugs.gnu.org; Mon, 26 Sep 2022 03:28:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:44722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ociXh-0008H3-EN for submit@debbugs.gnu.org; Mon, 26 Sep 2022 03:28:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ociXh-00023o-8j for guix-patches@gnu.org; Mon, 26 Sep 2022 03:28:41 -0400 Received: from mail.envs.net ([5.199.136.28]:36160) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ociXf-00063j-9D for guix-patches@gnu.org; Mon, 26 Sep 2022 03:28:40 -0400 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 9384938A0FAF; Mon, 26 Sep 2022 07:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1664177307; bh=9/+nvn8WChAUUV+3J7HnA2dmlJjtknS7GG63KUWr3Y4=; h=From:To:Cc:Subject:Date:From; b=p0OOb0EMde0lm0sroadJDxsHWtZjD7x/xbFjEjrYCIq0oh3TZcoVftEzKWd8Hc8EV td3kVvUn7BUhhBdqHmDiUf61qPC5E9t8ceVZpGNX2/NElLOzT2H9bYf88C6Y+O9FbN n4Fh9yv/Ct8IcZZFx+NfU0Z/PfH2xMAKt0oXtZG7131nhQxYeb1LrwYPhqhwxE+X+w Y/1K4dSVX1GWNiaGM6TR1USWXa0OBBfXDwhHWI+HHaUN3gKANAkf492Yoi7ntK/7h9 MAsUyAvsljp9/zIZQc8Wb72Rec8yhPR8bqzKo03XOj5hCoLRorz4ThuH89YQwsWAft 6sgLlVo/KkdnHfr7N1BaIlM8C3d15f1e1nqdJwiwzpcE0s9Ob/Nr4L10sSyfOJh/V1 oT+SnlY3TbUlsZCw1vYUyxdmXwvjvb/oTHWuXPfGQOKza9hrxzTLOtf8uOzeKi0Gbz RtRGRAu4o76CxT0y64R3ZX4VOThxvMMvTY8Q+WWJeblyJ8wHHv49KA5jZccDqFdLUz tI5f1X4VAkcbI0R33ClhqGlUjcmg22qX301k9eptQ3CQ6y762KzwI9Sjb60Rq8416y F9hFpX+5x6nNfveQ3sH4ZHiL5k4+qCuZlS0WoXlElaBmRaxiqXBSPFnHFFnL6Bkzed 6000qHgu3rIYeYBJeGlhW4fY= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2kjrR0VJni_Q; Mon, 26 Sep 2022 07:28:24 +0000 (UTC) Received: from localhost (unknown [182.150.116.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Mon, 26 Sep 2022 07:28:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id efc52026; Mon, 26 Sep 2022 07:28:27 +0000 (UTC) From: iyzsong@envs.net To: guix-patches@gnu.org Subject: [PATCH] gnu: Add fstrim-service-type. Date: Mon, 26 Sep 2022 15:28:25 +0800 Message-Id: <20220926072825.4689-1-iyzsong@envs.net> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=5.199.136.28; envelope-from=iyzsong@envs.net; helo=mail.envs.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) From: 宋文武 A timestamp file "/var/lib/mcron/fstrim.stamp" is used to ensure we will catch up on missed job runs when the system was powered down. * gnu/services/mcron.scm (%mcron-activation): New extension to create '/var/lib/mcron'. * gnu/services/admin.scm (fstrim-configuration): New record type. (fstrim-mcron-jobs): New procedure. (fstrim-service-type): New service type. --- gnu/services/admin.scm | 56 +++++++++++++++++++++++++++++++++++++++++- gnu/services/mcron.scm | 8 ++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 252bedb0bd..2b22fc5b33 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -21,6 +21,7 @@ (define-module (gnu services admin) #:use-module (gnu packages admin) #:use-module (gnu packages certs) + #:use-module (gnu packages linux) #:use-module (gnu packages package-management) #:use-module (gnu services) #:use-module (gnu services mcron) @@ -30,6 +31,7 @@ (define-module (gnu services admin) #:use-module (guix packages) #:use-module (guix records) #:use-module (srfi srfi-1) + #:use-module (ice-9 match) #:use-module (ice-9 vlist) #:export (%default-rotations %rotated-files @@ -63,7 +65,11 @@ (define-module (gnu services admin) unattended-upgrade-configuration-services-to-restart unattended-upgrade-configuration-system-expiration unattended-upgrade-configuration-maximum-duration - unattended-upgrade-configuration-log-file)) + unattended-upgrade-configuration-log-file + + fstrim-service-type + fstrim-configuration + fstrim-configuration?)) ;;; Commentary: ;;; @@ -376,4 +382,52 @@ (define unattended-upgrade-service-type "Periodically upgrade the system from the current configuration.") (default-value (unattended-upgrade-configuration)))) + +;;; +;;; fstrim. +;;; + +(define-record-type* + fstrim-configuration make-fstrim-configuration fstrim-configuration? + (command fstrim-configuration-command + (default + (list (file-append util-linux "/sbin/fstrim") + "--verbose" "--quiet-unsupported" + "--listed-in" "/etc/fstab"))) + (interval fstrim-configuration-interval (default (* 60 60 24 7)))) ; weekly + +;;; By storing the time of job's last run in a file, we can catch up on missed +;;; runs when the system was powered down. +(define fstrim-mcron-stamp "/var/lib/mcron/fstrim.stamp") + +(define fstrim-mcron-jobs + (match-lambda + (($ command interval) + (list + #~(job + (let ((last-time + (catch #t + (lambda () + (with-input-from-file #$fstrim-mcron-stamp read)) + ;; We schedule a first run immediately. + (const 0)))) + (lambda (current-time) + (let ((next-time (max current-time (+ #$interval last-time)))) + (set! last-time next-time) + next-time))) + (lambda () + (apply system* '#$command) + (with-output-to-file #$fstrim-mcron-stamp + (lambda () (write (current-time)))))))))) + +(define fstrim-service-type + (service-type + (name 'fstrim) + (extensions + (list (service-extension mcron-service-type + fstrim-mcron-jobs))) + (description + "Periodically discard unused blocks on filesystems.") + (default-value (fstrim-configuration)))) + ;;; admin.scm ends here diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm index 23760ebda4..833d979ab4 100644 --- a/gnu/services/mcron.scm +++ b/gnu/services/mcron.scm @@ -154,6 +154,12 @@ (define mcron-shepherd-services (actions (list (shepherd-schedule-action mcron files))))))))) +(define %mcron-activation + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/lib/mcron")))) + (define mcron-service-type (service-type (name 'mcron) (description @@ -161,6 +167,8 @@ (define mcron-service-type (extensions (list (service-extension shepherd-root-service-type mcron-shepherd-services) + (service-extension activation-service-type + (const %mcron-activation)) (service-extension profile-service-type (compose list mcron-configuration-mcron)))) -- 2.37.3 ------------=_1679494442-31224-1-- From unknown Thu Jun 19 14:29:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Bruno Victal Subject: bug#61964: closed (Re: bug#61964: [PATCH] services: Add fstrim-service-type.) Message-ID: References: <874jqcj2mo.fsf_-_@gmail.com> <9fec722b58c87211f019fa702a5c7047577bec64.1677952942.git.mirai@makinata.eu> X-Gnu-PR-Message: they-closed 61964 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch moreinfo Reply-To: 61964@debbugs.gnu.org Date: Wed, 22 Mar 2023 14:14:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1679494442-31224-3" This is a multi-part message in MIME format... ------------=_1679494442-31224-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #58086: [PATCH] services: Add fstrim-service-type. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 61964@debbugs.gnu.org. --=20 58086: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D58086 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1679494442-31224-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 58086-done) by debbugs.gnu.org; 22 Mar 2023 14:13:12 +0000 Received: from localhost ([127.0.0.1]:36238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pezDD-00085i-Tb for submit@debbugs.gnu.org; Wed, 22 Mar 2023 10:13:12 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:46981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pezDC-00085S-CN; Wed, 22 Mar 2023 10:13:11 -0400 Received: by mail-qt1-f181.google.com with SMTP id c19so22696320qtn.13; Wed, 22 Mar 2023 07:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679494384; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=zmW7UCXZKNr8xskYaS8Wc9v5Bg8vnCPXA01QWkpvMOs=; b=DXKWlEWe8dkzLzDZgwvz5zIySJPJY77Wu8VbbVeM2dMXj5w8dV6gYKFIxIUZM2jleG W1iYkHXh6+yYy0UG7/EcseDCejdJe2OVQSQjsWBu9Hy3inrKkxsXCV45PI78yAvWAKfO sbgUOcCICWir6lDX7GskmSxAxgj8eq1x3CyhNtUdkVoqnCEgLcnnVMrEw9+NKpCBp/sl ksMcMtx+W4e8o8dkWbu6sqKFFIh9FSlZpCpvX2dKslkf3QEz/FO4Ngs8wHak6u6dFFgh ivEMXSj0Wi7B4iLPEV140gv5j0LkwjdYaZEyXUpyYrupaQ1G5x/iUpkHOvEYxWgbxYwp ekMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679494384; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zmW7UCXZKNr8xskYaS8Wc9v5Bg8vnCPXA01QWkpvMOs=; b=N/nA5ZJBVKOxJgWXK1qql7Upx60FzU4YgCWfdxgys7k9PUYTE7yYaWBPKuxME/XjQG a1qEw9MwiwA9MjDe+3UH3UXw2Lime1lolhStiCH/oNPr5o0FcGcKjCrznX29BAJAITTN Akma1BjHQpNvVB2HFIXPnmoV2QNxNs9nNI5dLS7sOB61N2dzHj1KnB7HqrNT8aVAlENL fBbHpVIZ7XCSgVhtP5rTbfyRKQLEuB3vQ3rmrnYSsNvGFiPub+t2sER5KUoj232+GNDQ bNG5FRD0VkRIm5s6yqIuN0YqOXRqohCnNI8uQgt40u1IOd6NSsziCJIBJlGrj71pGSNd PqLQ== X-Gm-Message-State: AO0yUKV/+bR9Ml8vOkr5GhKLpe6O1IC/ifh7GzTkQRXPk4lVP3/PXtkK qgv2SbE3vhOG+J3jvcRjf9SZpTpIMXZxYQ== X-Google-Smtp-Source: AK7set8vnO1FFYHNfGlTdK5KXT5luQxNG7+BxN0ZhOol/rDV1k4L4GMCuvPBrwAaHVawXGAeI4vABQ== X-Received: by 2002:ac8:5b4e:0:b0:3e0:8c58:1dd with SMTP id n14-20020ac85b4e000000b003e08c5801ddmr5518613qtw.55.1679494384475; Wed, 22 Mar 2023 07:13:04 -0700 (PDT) Received: from hurd (dsl-10-130-195.b2b2c.ca. [72.10.130.195]) by smtp.gmail.com with ESMTPSA id e1-20020ac84901000000b003d460ec242esm10168532qtq.81.2023.03.22.07.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 07:13:04 -0700 (PDT) From: Maxim Cournoyer To: Bruno Victal Subject: Re: bug#61964: [PATCH] services: Add fstrim-service-type. References: <9fec722b58c87211f019fa702a5c7047577bec64.1677952942.git.mirai@makinata.eu> <2be8cc336a7e56ee6c15a57548c3b7690803101f.1679485589.git.mirai@makinata.eu> Date: Wed, 22 Mar 2023 10:13:03 -0400 In-Reply-To: <2be8cc336a7e56ee6c15a57548c3b7690803101f.1679485589.git.mirai@makinata.eu> (Bruno Victal's message of "Wed, 22 Mar 2023 11:47:19 +0000") Message-ID: <874jqcj2mo.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58086-done Cc: 61964-done@debbugs.gnu.org, 58086-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Bruno Victal writes: > * gnu/services/linux.scm (fstrim-service-type): New variable. > (fstrim-mcron-job, serialize-fstrim-configuration) > (fstrim-serialize-list-of-strings, fstrim-serialize-boolean): New procedure. > (mcron-time?): New predicate. > (fstrim-configuration): New record. > * doc/guix.texi (Linux Services): Document new fstrim-service-type. I've installed the change, with the following mostly cosmetic adjustments: --8<---------------cut here---------------start------------->8--- modified doc/guix.texi @@ -37493,7 +37493,7 @@ notifications. The command @command{fstrim} can be used to discard (or @dfn{trim}) unused blocks on a mounted file system. -@c This was copied from the fstrim manpage, with some texinfo touch-ups. +@c This was copied from the fstrim manpage, with some Texinfo touch-ups. @quotation Warning Running @command{fstrim} frequently, or even using @command{mount -o discard}, might negatively affect the lifetime of @@ -37540,8 +37540,8 @@ Verbose execution. Suppress error messages if trim operation (ioctl) is unsupported. @item @code{extra-arguments} (type: maybe-list-of-strings) -Extra options to append to @command{fstrim} command.@footnote{Run -@samp{man fstrim} for more information.} +Extra options to append to @command{fstrim} (run @samp{man fstrim} for +more information). @end table @end deftp modified gnu/services/linux.scm @@ -185,10 +185,9 @@ (define (fstrim-serialize-list-of-strings field-name value) (define-configuration fstrim-configuration (package - (file-like util-linux) - "The package providing the @command{fstrim} command." - empty-serializer) - + (file-like util-linux) + "The package providing the @command{fstrim} command." + empty-serializer) (schedule (mcron-time "0 0 * * 0") "Schedule for launching @command{fstrim}. This can be a procedure, a list @@ -196,8 +195,7 @@ (define-configuration fstrim-configuration Job specification, mcron, the mcron manual}. By default this is set to run weekly on Sunday at 00:00." empty-serializer) - - ;; fstrim options + ;; The following are fstrim-related options. (listed-in (maybe-list-of-strings '("/etc/fstab" "/proc/self/mountinfo")) ;; Note: documentation sourced from the fstrim manpage. @@ -205,27 +203,19 @@ (define-configuration fstrim-configuration empty files are silently ignored. The evaluation of the list @emph{stops} after the first non-empty file. File systems with @code{X-fstrim.notrim} mount option in fstab are skipped.") - (verbose? (boolean #t) "Verbose execution.") - (quiet-unsupported? (boolean #t) "Suppress error messages if trim operation (ioctl) is unsupported.") - (extra-arguments maybe-list-of-strings - ;; Tracked at: . - ;; FIXME@GUILE(TEXINFO): @footnote causes errors when calling - ;; configuration->documentation. - ;; > Throw to key `parser-error' with args `(#f "Unknown command" footnote)' - "Extra options to append to @command{fstrim} command.@footnote{Run -@samp{man fstrim} for more information.}" + "Extra options to append to @command{fstrim} (run @samp{man fstrim} for +more information)." (lambda (_ value) (if (maybe-value-set? value) value '()))) - (prefix fstrim-)) (define (serialize-fstrim-configuration config) --8<---------------cut here---------------end--------------->8--- Thank you! -- Maxim ------------=_1679494442-31224-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Mar 2023 18:04:00 +0000 Received: from localhost ([127.0.0.1]:37704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYWEi-0007s8-3E for submit@debbugs.gnu.org; Sat, 04 Mar 2023 13:04:00 -0500 Received: from lists.gnu.org ([209.51.188.17]:48634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYWEg-0007s0-2K for submit@debbugs.gnu.org; Sat, 04 Mar 2023 13:03:58 -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 1pYWEf-0001Xe-QE for guix-patches@gnu.org; Sat, 04 Mar 2023 13:03:57 -0500 Received: from smtpm4.myservices.hosting ([185.26.105.235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYWEd-0000E2-Ps for guix-patches@gnu.org; Sat, 04 Mar 2023 13:03:57 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id 1C3CD20AE4 for ; Sat, 4 Mar 2023 19:03:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id C954480097; Sat, 4 Mar 2023 19:03:41 +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 M09wF7cnjDEO; Sat, 4 Mar 2023 19:03:37 +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 5BFED80079; Sat, 4 Mar 2023 19:03:37 +0100 (CET) From: Bruno Victal To: guix-patches@gnu.org Subject: [PATCH] services: Add fstrim-service-type. Date: Sat, 4 Mar 2023 18:03:28 +0000 Message-Id: <9fec722b58c87211f019fa702a5c7047577bec64.1677952942.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.105.235; envelope-from=mirai@makinata.eu; helo=smtpm4.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * gnu/services/linux.scm (fstrim-service-type): New variable. (fstrim-mcron-job, serialize-fstrim-configuration) (fstrim-serialize-list-of-strings, fstrim-serialize-boolean): New procedure. (mcron-time?): New predicate. (fstrim-configuration): New record. * doc/guix.texi (Linux Services): Document new fstrim-service-type. --- doc/guix.texi | 62 +++++++++++++++++++++++ gnu/services/linux.scm | 109 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 74658dbc86..d5a83e387f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37436,6 +37436,68 @@ Linux Services @end table @end deftp +@cindex fstrim service +@cindex solid state drives, periodic trim +@cindex solid state drives, trim +@subsubheading fstrim Service + +The command @command{fstrim} can be used to discard (or @dfn{trim}) +unused blocks on a mounted filesystem. + +@c This was copied from the fstrim manpage, with some texinfo touch-ups. +@quotation Warning +Running @command{fstrim} frequently, or even using +@command{mount -o discard}, might negatively affect the lifetime of +poor-quality SSD devices. For most desktop and server systems a +sufficient trimming frequency is once a week. Note that not all devices +support a queued trim, so each trim command incurs a performance penalty +on whatever else might be trying to use the disk at the time. +@end quotation + +@defvar fstrim-service-type +Type for a service that periodically runs @command{fstrim}, whose value must +be a @code{} object. The service can be instantiated +in its default configuration with: + +@lisp +(service fstrim-service-type) +@end lisp +@end defvar + +@c %start of fragment +@deftp {Data Type} fstrim-configuration +Available @code{fstrim-configuration} fields are: + +@table @asis +@item @code{package} (default: @code{util-linux}) (type: file-like) +The package providing @command{fstrim}. + +@item @code{schedule} (default: @code{"0 0 * * 0"}) (type: mcron-time) +Schedule for launching @command{fstrim}. This can be a procedure, a +list or a string. For additional information, @pxref{Guile Syntax,, Job +specification, mcron,the mcron manual}. By default this is set to run +weekly on Sunday at 00:00. + +@item @code{listed-in} (default: @code{("/etc/fstab" "/proc/self/mountinfo")}) (type: maybe-list-of-strings) +List of files in fstab or kernel mountinfo format. All missing or empty +files are silently ignored. The evaluation of the list @emph{stops} +after the first non-empty file. Filesystems with @code{X-fstrim.notrim} +mount option in fstab are skipped. + +@item @code{verbose?} (default: @code{#t}) (type: boolean) +Verbose execution. + +@item @code{quiet-unsupported?} (default: @code{#t}) (type: boolean) +Suppress error messages if trim operation (ioctl) is unsupported. + +@item @code{extra-arguments} (type: maybe-list-of-strings) +Extra options to append to @command{fstrim} command.@footnote{Run +@command{man fstrim} for more information.} + +@end table +@end deftp +@c %end of fragment + @cindex modprobe @cindex kernel module loader @subsubheading Kernel Module Loader Service diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm index 60e2093e1d..f5ec5fec48 100644 --- a/gnu/services/linux.scm +++ b/gnu/services/linux.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2021 B. Wilson ;;; Copyright © 2022 Josselin Poiret +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,12 +31,15 @@ (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 mcron) #: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? @@ -50,6 +54,16 @@ (define-module (gnu services linux) earlyoom-configuration-send-notification-command earlyoom-service-type + fstrim-configuration + fstrim-configuration? + fstrim-configuration-package + fstrim-configuration-schedule + fstrim-configuration-listed-in + fstrim-configuration-verbose? + fstrim-configuration-quiet-unsupported? + fstrim-configuration-extra-arguments + fstrim-service-type + kernel-module-loader-service-type rasdaemon-configuration @@ -150,6 +164,101 @@ (define earlyoom-service-type (compose list earlyoom-shepherd-service)))) (description "Run @command{earlyoom}, the Early OOM daemon."))) + +;;; +;;; fstrim +;;; + +(define (mcron-time? x) + (or (procedure? x) (string? x) (list? x))) + +(define-maybe list-of-strings (prefix fstrim-)) + +(define (fstrim-serialize-boolean field-name value) + (list (format #f "~:[~;--~a~]" value + ;; drop trailing '?' character + (string-drop-right (symbol->string field-name) 1)))) + +(define (fstrim-serialize-list-of-strings field-name value) + (list (string-append "--" (symbol->string field-name)) + #~(string-join '#$value ":"))) + +(define-configuration fstrim-configuration + (package + (file-like util-linux) + "The package providing @command{fstrim}." + empty-serializer) + + (schedule + (mcron-time "0 0 * * 0") + "Schedule for launching @command{fstrim}. This can be a procedure, a list +or a string. For additional information, @pxref{Guile Syntax,, +Job specification, mcron, the mcron manual}. By default this is set to run +weekly on Sunday at 00:00." + empty-serializer) + + ;; fstrim options + (listed-in + (maybe-list-of-strings '("/etc/fstab" "/proc/self/mountinfo")) + ;; XXX: documentation sourced from the fstrim manpage. + "List of files in fstab or kernel mountinfo format. All missing or +empty files are silently ignored. The evaluation of the list @emph{stops} +after the first non-empty file. Filesystems with @code{X-fstrim.notrim} mount +option in fstab are skipped.") + + (verbose? + (boolean #t) + "Verbose execution.") + + (quiet-unsupported? + (boolean #t) + "Suppress error messages if trim operation (ioctl) is unsupported.") + + (extra-arguments + maybe-list-of-strings + ;; FIXME@GUILE(TEXINFO): @footnote causes errors when calling + ;; configuration->documentation. + ;; > Throw to key `parser-error' with args `(#f "Unknown command" footnote)' + "Extra options to append to @command{fstrim} command.@footnote{Run +@command{man fstrim} for more information.}" + (lambda (_ value) + (if (maybe-value-set? value) + value '()))) + + (prefix fstrim-)) + +(define (serialize-fstrim-configuration config) + (concatenate + (filter list? + (map (lambda (field) + ((configuration-field-serializer field) + (configuration-field-name field) + ((configuration-field-getter field) config))) + fstrim-configuration-fields)))) + +(define (fstrim-mcron-job config) + (match-record config (package schedule) + #~(job + ;; XXX: The “if” below is to ensure that + ;; lists are ungexp'd correctly since @var{schedule} + ;; can be either a procedure, a string or a list. + #$(if (list? schedule) + `(list ,@schedule) + schedule) + (lambda () + (system* #$(file-append package "/sbin/fstrim") + #$@(serialize-fstrim-configuration config))) + "fstrim"))) + +(define fstrim-service-type + (service-type + (name 'fstrim) + (extensions + (list (service-extension mcron-service-type + (compose list fstrim-mcron-job)))) + (description "Discard unused blocks from filesystems.") + (default-value (fstrim-configuration)))) + ;;; ;;; Kernel module loader. base-commit: d6045055720bc0763f8a079d75b941b4898349a4 -- 2.39.1 ------------=_1679494442-31224-3-- From unknown Thu Jun 19 14:29:11 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58086] [PATCH] gnu: Add fstrim-service-type. Resent-From: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 24 Mar 2023 10:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58086 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: Bruno Victal Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 58086@debbugs.gnu.org, Maxim Cournoyer Received: via spool by 58086-submit@debbugs.gnu.org id=B58086.16796537159001 (code B ref 58086); Fri, 24 Mar 2023 10:29:02 +0000 Received: (at 58086) by debbugs.gnu.org; 24 Mar 2023 10:28:35 +0000 Received: from localhost ([127.0.0.1]:39891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfeex-0002L7-3a for submit@debbugs.gnu.org; Fri, 24 Mar 2023 06:28:35 -0400 Received: from mail.envs.net ([5.199.136.28]:55536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfeeV-0002Jt-Eb for 58086@debbugs.gnu.org; Fri, 24 Mar 2023 06:28:34 -0400 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 2F58738A088F; Fri, 24 Mar 2023 10:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1679653674; bh=1IY73vOSAG4TfGCsCAN7tcgVnaT7/w+8cvUSuW60/MA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dGMyobjNVHnB9OmRtyFVR3y+fD6Em5bVADgtR11UaWzFXPlxvOTfzGoM6K88GYFV7 bwpFrxggqWDY88I8DZIrQ3DHxwNC4LKNiL4mwwF6grl5TRGZo2WIiVQQrBygU7Cx1T jhA7YbLuqHDSoCKcPZLMcRm2r77Umdfj/yU2Q/gKnJR0hY/Of17pmfS50UQAo5Dbr5 sqvih2oJN87vMKAVGQ6LwhLl6bqVDi7Hnxe2/WCTpcH6l5ett4mXc76oOKd/It8b8R iFRRQot+3kd1AsbJNULZaoYsQeWXgS4z71fNm5rNnzY6oykNmlr3RjGClUXUB+/yfk AHk4zc7ngmfbl5SGdr3XQ6ZIAsBdS2eTDiB7OQ//9hSEgKTo7hYM7HbFQDKhV+zQCs 207TR/eRJMuTlUDTcX6VdvDnELNaVZptCQcTNX2sMYiDIFRM+DbjYfO0z3GSeVily1 wSugta69IqraSEvt7k1pLXdtyX53tacPQf4a01P1zgTmu2ooG6nsrjWgrVS4L8qyr7 cjvofqVXpHN+MG+FiWUN+HxRZhk5DaWPKi+Bz9AU9Sj6RloVKo563LA4+g95xw49mH rg6WOREF/f/S+pSKGEt/iPSM3SwsMEkcXNRpPddrZGzP+8oE+dSqzXvPzCHp0i2MqV w1+LtbYO1mZiL05aim5qWoiM= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id E-qooKRtNQwF; Fri, 24 Mar 2023 10:27:46 +0000 (UTC) Received: from localhost (unknown [36.170.44.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Fri, 24 Mar 2023 10:27:46 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 62bce124; Fri, 24 Mar 2023 10:28:21 +0000 (UTC) From: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= References: <20220926072825.4689-1-iyzsong@envs.net> <1a1991d3-afc0-4e2b-50a4-dfad763907f7@makinata.eu> Date: Fri, 24 Mar 2023 18:28:21 +0800 In-Reply-To: <1a1991d3-afc0-4e2b-50a4-dfad763907f7@makinata.eu> (Bruno Victal's message of "Wed, 22 Mar 2023 12:03:44 +0000") Message-ID: <87o7oijvei.fsf@envs.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Bruno Victal writes: > I didn't notice this patch and ended up reimplementing another fstrim-ser= vice-type at [1]. > Where we differ in the implementations: > * I didn't attempt to implement anacron capabilities, since I made the sc= heduling configurable. > * Uses define-configuration which can embed documentation and generate it= for the manual. > * Slightly more =E2=80=9Cguix-y=E2=80=9D style of configuration. Yes, that's indeed better, thank you! I had forgot my patch...