From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OPJmFFANG2T/UgEASxT56A (envelope-from ) for ; Wed, 22 Mar 2023 15:14:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eJRmFFANG2T9WAEA9RJhRA (envelope-from ) for ; Wed, 22 Mar 2023 15:14:40 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0F0AC31A7C for ; Wed, 22 Mar 2023 15:14:39 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pezEE-0005Gi-TD; Wed, 22 Mar 2023 10:14:15 -0400 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 1pezE4-0005Ev-F5 for guix-patches@gnu.org; Wed, 22 Mar 2023 10:14:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pezE2-0001AU-MA for guix-patches@gnu.org; Wed, 22 Mar 2023 10:14:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pezE2-00087k-Fo for guix-patches@gnu.org; Wed, 22 Mar 2023 10:14:02 -0400 Subject: bug#58086: bug#61964: [PATCH] services: Add fstrim-service-type. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Wed, 22 Mar 2023 14:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 58086 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: Bruno Victal Cc: 61964-done@debbugs.gnu.org, 58086-done@debbugs.gnu.org Mail-Followup-To: 58086@debbugs.gnu.org, maxim.cournoyer@gmail.com, iyzsong@envs.net Received: via spool by 58086-done@debbugs.gnu.org id=D58086.167949439231110 (code D ref 58086); Wed, 22 Mar 2023 14:14:02 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679494480; a=rsa-sha256; cv=none; b=PwT5zvhw1Fls9fsW6rjLxX5Ncurx4CbReggYCGsGlepNqkgd9pKfa3Lpn7jI02hPwAes04 rzR7vEMv5Ky3ZOOBdy+ICheId5uzeS/jXuBmunGfMkOuxgqElhDeyH1Z/fkho9GQsnUkp5 kAXFmi9pnGjnzATvyrrQyr6tgV93wYF0hrSMINK1cZvGc3Q3GW8/vGcX7MOaYJAEUjcSDq bDaoLJabULD9fG3V+DX82FooFS87E9WKte5AZ8rpBfNaV/7VVFSAZRERk27Biei3mEkmKB nfcO4qMraq2mxz9XVbjkXgzCl5E806avaHzINGWHwzSOv5nqjH5B5rHNcO+bAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=DXKWlEWe; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679494480; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=zmW7UCXZKNr8xskYaS8Wc9v5Bg8vnCPXA01QWkpvMOs=; b=XSBPZw2TlNAPpwuxJIfQEsidhywnNiYu+nMUr5vDQI4etgwsfedeNndDYjraR8hkT4CJaH KIK2TCHJXSQiSlX+emnB5zW8U6eFFgwWKI4qdQz+Rhsykk9SzLlHWoJKBOoZu3ygw57q63 3k+I2Fu5k5aSDSkTETuhTb0Mer1lSiu5twMsufKlAJeoYlFIF5DQ0iji6791LOfjnoC+zs w0xn7keDLPOqQu3RY9umbj+O+/au3d9YpsBvRpnZ2LijSFXU2Ea3i7Ka/3lm2ohn7YMNsP 2l9kqlYUFAjT/iFW9eBFv3ChUFpji8hVxrxv1ij+uH7eGcbD4KkFIdJ6kfMAcw== X-Migadu-Spam-Score: -0.65 X-Spam-Score: -0.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=DXKWlEWe; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-Migadu-Queue-Id: 0F0AC31A7C X-Migadu-Scanner: scn1.migadu.com X-TUID: 7E0UAI2T8yUz 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