From patchwork Fri Dec 13 22:58:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34884 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F318827BBE9; Fri, 13 Dec 2024 23:02:59 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4441827BBE2 for ; Fri, 13 Dec 2024 23:02:58 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEff-0003xp-Ld; Fri, 13 Dec 2024 18:02:08 -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 1tMEfb-0003wT-GO for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfb-0002l0-7N for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=ck5RB+7X5Y4twrkXw7VRA2BecAKwrVZgpL5C6qb/XhM=; b=U52La9gMBPTnDDstT6YZrJF1jyRlz3rPCF0XBt8gTjQBdOEbGtL6jLFAKBFl03+VnAh/8QBWyyonox5iiFW4VkNhcEbivyu+PwzRu1ZfnHmyKBLsm9WYwOgC1flu+A7dvSN1Nu7yUzKw+biFw4LAy8T+H0Tardg8RBo3iYWVRsbJK8yjsHuudiIVcqGLFghb1nDctpCDduyQY289/3FH3h6ArT3GEp32Qfp1qll8GDXJk0TS5gCRucCzHF3/f792BCYuacQcjYkS7eef4yfOanx8y1qCwHdCrxffaq7yh9cxeMt42MQDilKEmz32nbMbgCYJo01VCbQZf5zDZS0yHQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfZ-0001Xz-Nd; Fri, 13 Dec 2024 18:02:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 01/10] gnu: shepherd@1.0: Add dependency on gzip and zstd. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Sharlatan Hellseher X-Debbugs-Original-Xcc: Sharlatan Hellseher Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341308735749 (code B ref 74860); Fri, 13 Dec 2024 23:02:01 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:13 +0000 Received: from localhost ([127.0.0.1]:44547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEem-0001UZ-4X for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEej-0001UB-CR for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:10 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEcW-0001m1-OE; Fri, 13 Dec 2024 17:58:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ck5RB+7X5Y4twrkXw7VRA2BecAKwrVZgpL5C6qb/XhM=; b=BsWdNCa2iwiqAKXqEOHo 5uq7xVNQWF8WaL4veRc2oNHvWhKYBqh3vS+/FGok5LD50NSojhZvZB+iBSmXd2OhIbNwFb2a6uvlE XcPcH+YnGB4GmJN57g5MM9jxB1HyrMu5JYkKJxPUD1FFuvslTBtJerk9GxahcMB0ZyoIitFIRC3Tw /Y/ki2jUChL11E/RNJhZOkvp8f3sd9Xc80WHlNlFC0nBZ0ZTPhXN6wuCcE1eqesYt6guvBV0sifVG 1Tzi2TzcvPalPv9oe5p1x6lXhGRTTf8ZiVpd7feZkK5tdliOX3dYw8WKmiuaC5cXIFaMFd7t+j6/i t/ajz4Iaoj7VsA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:21 +0100 Message-ID: <461c117e9341d9264ed33a2437ee3cba8e1e784e.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (shepherd-1.0)[arguments]: New field. [inputs]: New field. Change-Id: If21f876bbf3fba933a8d997a95db91b961adfca3 --- gnu/packages/admin.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index b1889ceea0..045594bdc7 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -424,7 +424,19 @@ (define-public shepherd-1.0 version ".tar.gz")) (sha256 (base32 - "0z4yxl8g0k3b6k4x7b3ks10x31hs46j5kmw0ah5cr417n0rszrp8")))))) + "0z4yxl8g0k3b6k4x7b3ks10x31hs46j5kmw0ah5cr417n0rszrp8")))) + (arguments + (substitute-keyword-arguments (package-arguments shepherd-0.10) + ((#:configure-flags flags #~'()) + #~(list "--localstatedir=/var" + + ;; Gzip and zstd are used by the log rotation service. + (string-append "--with-gzip=" #$(this-package-input "gzip") + "/bin/gzip") + (string-append "--with-zstd=" #$(this-package-input "zstd") + "/bin/zstd"))))) + (inputs (modify-inputs (package-inputs shepherd-0.10) + (append gzip zstd))))) (define-public shepherd shepherd-0.10) From patchwork Fri Dec 13 22:58:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34882 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7C38527BBEA; Fri, 13 Dec 2024 23:02:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BA2E727BBE2 for ; Fri, 13 Dec 2024 23:02:52 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEfo-0003zb-2N; Fri, 13 Dec 2024 18:02:16 -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 1tMEfc-0003wY-Vi for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfb-0002l6-Fx; Fri, 13 Dec 2024 18:02:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=JRkADmX1N01CEy04CsN/j0Ua8rLTsUFJpNlG2OSfkxI=; b=n2ddFyYmj2ddHP7cQeM9t3p8CcBxD1vdtLrpJFttoeQyT8plV4K0AeFgmWBxCaE3/Q9PNLtGg25N3ry+/C0mXqhM5JOG/xtJd47eZk5K7x1ZiiNgtfTfYzlPf8zfp8ZgwErH9gu9I1wuTLsUyE72926pZFU9Swrw84wKDPXpHFVcSIzxkoMvPWp4pnn4OXfoRZMuXtkKSib7AzIW4CNXesI5M7jjkCp7r4lEtGfaXFI1lwbpupJ7SxO4GxW7YQhF3n9P2BjVcZFwxI54E3poh1LKEhJuWQG5F9eV0/DcEpMc00biwXeQUNenSUGIKZ75keW2GXWxt2B3pJURgrkgng==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfa-0001Y5-9Z; Fri, 13 Dec 2024 18:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 02/10] services: Add =?utf-8?b?4oCYbG9nLXJvdGF0?= =?utf-8?b?aW9uLXNlcnZpY2UtdHlwZeKAmS4=?= Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341308765772 (code B ref 74860); Fri, 13 Dec 2024 23:02:02 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:16 +0000 Received: from localhost ([127.0.0.1]:44553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEep-0001Uw-ST for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEel-0001UJ-Dq for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:12 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEcZ-0001mJ-CA; Fri, 13 Dec 2024 17:58:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=JRkADmX1N01CEy04CsN/j0Ua8rLTsUFJpNlG2OSfkxI=; b=exEidfpgm66+qIGqlO6v wmHw8fR/wk3O8QiVacOjRoUvW+tZBjeiB4bvIzuuWfp3/dzIFJdg5xK0uI9tvY8oZmF0MLRK9rY2l YKeq7aWk5iY64ZaQrsC3wTz63UdjkRYlL1rd3QySzsmWbzWPwe5lTTMfe0wTdVokngQLm5QegEhZy 2roDbUPxr3iXoTxO04fO7aN0qAGR38pU13oF1TJb4nkl/x0Kh55TM47TJIE3JxQHsS1aYzdzWFxFW 1Ep4XFa9pfroJmImuCeOiM/W6tEl/2Sh7oXvvyEdi1mypZLxivBr2Yc6x59sIwCuoL90rHS5MHAU6 OMCSyxkaSSU8MQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:22 +0100 Message-ID: <97dd04a5fbb49bcacc4b7d61749f64c8c6fae9d5.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/admin.scm (%default-log-rotation-calendar-event): New variable. (): New record type. (log-rotation-shepherd-services): New procedure. (log-rotation-service-type): New variable. Change-Id: I4400035f3b6065ec147ac932110b690120d739c2 --- doc/guix.texi | 73 +++++++++++++++++++++++++++++++- gnu/services/admin.scm | 95 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 159 insertions(+), 9 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a2915de954..89a85961ac 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20766,8 +20766,77 @@ Log Rotation Log files such as those found in @file{/var/log} tend to grow endlessly, so it's a good idea to @dfn{rotate} them once in a while---i.e., archive their contents in separate files, possibly compressed. The @code{(gnu -services admin)} module provides an interface to GNU@tie{}Rot[t]log, a -log rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}). +services admin)} module provides an interface to the log rotation +service provided by the Shepherd (@pxref{Log Rotation,,, shepherd, The +GNU Shepherd Manual}). + +This log rotation service is made available through +@code{log-rotation-service-type}, which takes a +@code{log-rotation-configuration} record has its value. By default, +this provides @code{log-rotation}, a Shepherd ``timed service'' that +runs periodically---once a week by default. It automatically knows +about the log files produced by Shepherd services and can be taught +about external log files. You can inspect the service and see when it's +going to run the usual way: + +@example +$ sudo herd status log-rotation +Status of log-rotation: + It is running since Mon 09 Dec 2024 03:27:47 PM CET (2 days ago). + @dots{} + +Upcoming timer alarms: + Sun 15 Dec 2024 10:00:00 PM CET (in 4 days) + Sun 22 Dec 2024 10:00:00 PM CET (in 11 days) + Sun 29 Dec 2024 10:00:00 PM CET (in 18 days) +@end example + +You can also list files subject to rotation with @command{herd files +log-rotation} and trigger rotation manually with @command{herd trigger +log-rotation}. + +@defvar log-rotation-service-type +This is the type of the log rotation service. Its associated value must +be a @code{log-rotation-configuration} record, as discussed below. +@end defvar + +@deftp {Data Type} log-rotation-configuration +This data type represents the configuration of the log rotation service. +Its defaults should be good for most use cases. + +@table @asis +@item @code{calendar-event} (default: every Sunday at 10PM) +This is a gexp containing the @dfn{calendar event} when log rotation +occurs. @xref{Timers,,, shepherd, The GNU Shepherd Manual}, for more +information on calendar events. + +@item @code{external-log-files} (default: @code{'()}) +This is a list of file names, external log files that should also be +rotated. + +@item @code{compression} (default: @code{'gzip}) +This is the compression method used for rotated log files, one of +@code{'none}, @code{'gzip}, and @code{'zstd}. + +@item @code{expiry} (default: @code{#~(%default-log-expiry)}) +Age in seconds after which a log file is deleted. + +@item @code{size-threshold} @ + (default: @code{#~(%default-rotation-size-threshold)}) +Size in bytes below which a log file is @emph{not} rotated. + +@item @code{provision} (default: @code{'(log-rotation)}) +@itemx @code{requirement} (default: @code{'(user-processes)}) +These are the name(s) and dependencies of the log rotation Shepherd +service. +@end table +@end deftp + +@subheading Rottlog + +An alternative log rotation service relying on GNU@tie{}Rot[t]log, a log +rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}), is also +provided. This service is part of @code{%base-services}, and thus enabled by default, with the default settings, for commonly encountered log files. diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 24ff659a01..5e1c197d78 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Jan Nieuwenhuizen -;;; Copyright © 2016-2023 Ludovic Courtès +;;; Copyright © 2016-2024 Ludovic Courtès ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2023 Giacomo Leidi ;;; @@ -39,7 +39,18 @@ (define-module (gnu services admin) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:use-module (ice-9 vlist) - #:export (%default-rotations + #:export (log-rotation-configuration + log-rotation-configuration? + log-rotation-configuration-provision + log-rotation-configuration-requirement + log-rotation-configuration-calendar-event + log-rotation-configuration-external-log-files + log-rotation-configuration-compression + log-rotation-configuration-expiry + log-rotation-configuration-size-threshold + log-rotation-service-type + + %default-rotations %rotated-files log-rotation @@ -97,14 +108,84 @@ (define-module (gnu services admin) ;;; Commentary: ;;; -;;; This module implements configuration of rottlog by writing -;;; /etc/rottlog/{rc,hourly|daily|weekly}. Example usage -;;; -;;; (mcron-service) -;;; (service rottlog-service-type) +;;; This module provides basic system administration tools: log rotation, +;;; unattended upgrades, etc. ;;; ;;; Code: + +;;; +;;; Shepherd's log rotation service. +;;; + +(define %default-log-rotation-calendar-event + ;; Default calendar event when log rotation is triggered. + #~(calendar-event #:minutes '(0) + #:hours '(22) + #:days-of-week '(sunday))) + +(define-record-type* + log-rotation-configuration make-log-rotation-configuration + log-rotation-configuration? + (provision log-rotation-configuration-provision (default '(log-rotation))) + (requirement log-rotation-configuration-requirement + (default (if for-home? '() '(user-processes)))) + (calendar-event log-rotation-configuration-calendar-event + (default %default-log-rotation-calendar-event)) + (external-log-files log-rotation-configuration-external-log-files + (default '())) + (compression log-rotation-configuration-compression (default 'gzip)) + (expiry log-rotation-configuration-expiry + (default #~(%default-log-expiry))) + (size-threshold log-rotation-configuration-size-threshold + (default #~(%default-rotation-size-threshold)))) + +(define (log-rotation-shepherd-services config) + (list (shepherd-service + (provision (log-rotation-configuration-provision config)) + (requirement (log-rotation-configuration-requirement config)) + (modules '((shepherd service timer) ;for 'calendar-event' + (shepherd service log-rotation))) + (free-form #~(log-rotation-service + #$(log-rotation-configuration-calendar-event config) + #:provision + '#$(log-rotation-configuration-provision config) + #:requirement + '#$(log-rotation-configuration-requirement config) + #:external-log-files + '#$(log-rotation-configuration-external-log-files + config) + #:compression + '#$(log-rotation-configuration-compression config) + #:expiry + #$(log-rotation-configuration-expiry config) + #:rotation-size-threshold + #$(log-rotation-configuration-size-threshold + config)))))) + +(define log-rotation-service-type + (service-type + (name 'log-rotation) + (description + "Periodically rotate log files using the Shepherd's log rotation service. +Run @command{herd status log-rotation} to view its status, @command{herd files +log-rotation} to list files subject to log rotation.") + (extensions (list (service-extension shepherd-root-service-type + log-rotation-shepherd-services))) + (compose concatenate) + (extend (lambda (config log-files) + (log-rotation-configuration + (inherit config) + (external-log-files + (append (log-rotation-configuration-external-log-files config) + log-files))))) + (default-value (log-rotation-configuration)))) + + +;;; +;;; Rottlog + mcron. +;;; + (define-record-type* log-rotation make-log-rotation log-rotation? (files log-rotation-files) ;list of strings From patchwork Fri Dec 13 22:58:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34880 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D8FC027BBEA; Fri, 13 Dec 2024 23:02:49 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9855C27BBE2 for ; Fri, 13 Dec 2024 23:02:49 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEfo-00040E-WC; Fri, 13 Dec 2024 18:02:17 -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 1tMEfb-0003wU-N3 for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfb-0002l1-C5; Fri, 13 Dec 2024 18:02:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=ayNrXZNb9B0f9xIavfgpUE0NtMrhv2/ggHdcgnRLIa8=; b=WCizCW2u8ddZ4Mw4z5cZuVpzbRKTdDnBfNPZGLy4MkiSRb3ZFrVz0mPeF3frEHri1FrI6oaJ8rMt5yoh6abICgBz1OeXHm/K95v9ZSwLoE23PwxrGkGb1jr//ULkHJj5VVLubF+vbHef6GojsJu4WmziokF8SprL6ZqO/g3YBubyeFNySecT3mcBPAdNJRXPse7m8O16W/+wrEJSWT9gdSN9bmIdx2jsZ+UyPahe9EaBrl5Npo+DVIMokYtg7nAZaUNXlrBaqDlugDgQ1hJ1JKrp7sL47SF11S9D/28Md4pxaRA6aL9aqfdMgwbHjYsubNzuYIjEQb+NftjwkikHeQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfa-0001YC-Oh; Fri, 13 Dec 2024 18:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 03/10] services: log-cleanup: Rewrite as a Shepherd timer. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341308775779 (code B ref 74860); Fri, 13 Dec 2024 23:02:02 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:17 +0000 Received: from localhost ([127.0.0.1]:44555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEeq-0001V3-Sc for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEen-0001UN-Fa for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:13 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEcb-0001mZ-Uw; Fri, 13 Dec 2024 17:58:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ayNrXZNb9B0f9xIavfgpUE0NtMrhv2/ggHdcgnRLIa8=; b=TmOGmgRg9vNCK5mORad9 Lx/8QFkRIErgCdEKqdTt/orB5uDvXGru+Zi4E2kUqlFAwYci7zU2YlwDoOjKh1kU2IOhtOiHJz0SG kfxKvTFEU0eL3uv2FLXIpseMR2fmNjLy6qf4r3YmKf5a9TzbOz8B7jD7STWRyex7K1qvuXF2nIGB4 KSi44DWfKeILpDcK8smfKSRUtcR/lGpVuB/YjQ6xpTmm4vd8DPLmp5R7XNmtW5pWd39BvrKWvBa9J yLbzOqpSGFpduF/gsCJ07J2nsO9wiNi5eJk1569drjD9ntRW0OgBEsbVAEhP1k+denwWU4C7w2+a1 WZAYvWw8FCEfNw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:23 +0100 Message-ID: <3a485dfad94faba0205b96f0b742bea6056512a7.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This is a semi-incompatible change: gexps previously provided in the ‘schedule’ field will no longer work. * gnu/services/admin.scm (log-cleanup-mcron-jobs): Remove. (log-cleanup-shepherd-services): New procedure. (log-cleanup-service-type): Extend SHEPHERD-ROOT-SERVICE-TYPE instead of MCRON-SERVICE-TYPE. * doc/guix.texi (Log Rotation): Adjust ‘schedule’ documentation accordingly. Change-Id: I2a3beb7dffbc9992b714a29423674db9c7dc6cab Reviewed-by: Maxim Cournoyer --- doc/guix.texi | 5 +++-- gnu/services/admin.scm | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 89a85961ac..e7784404d6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20973,8 +20973,9 @@ Log Rotation default). @item @code{schedule} (default: @code{"30 12 01,08,15,22 * *"}) -String or gexp denoting the corresponding mcron job schedule -(@pxref{Scheduled Job Execution}). +This is the schedule of the log cleanup job written either a string in +traditional cron syntax or as a gexp representing a Shepherd calendar +event (@pxref{Timers,,, shepherd, The GNU Shepherd Manual}). @end table @end deftp diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 5e1c197d78..aa1f56e90a 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -349,18 +349,31 @@ (define (log-cleanup-program directory expiry) (length logs) #$directory) (for-each delete-file logs)))))) -(define (log-cleanup-mcron-jobs configuration) +(define (log-cleanup-shepherd-services configuration) (match-record configuration - (directory expiry schedule) - (list #~(job #$schedule - #$(log-cleanup-program directory expiry))))) + (directory expiry schedule) + (let ((program (log-cleanup-program directory expiry))) + (list (shepherd-service + (provision '(log-cleanup)) + (requirement '(user-processes)) + (modules '((shepherd service timer))) + (start #~(make-timer-constructor + #$(if (string? schedule) + #~(cron-string->calendar-event #$schedule) + schedule) + (command '(#$program)))) + (stop #~(make-timer-destructor)) + (actions (list (shepherd-action + (name 'trigger) + (documentation "Trigger log cleanup.") + (procedure #~trigger-timer))))))))) (define log-cleanup-service-type (service-type (name 'log-cleanup) (extensions - (list (service-extension mcron-service-type - log-cleanup-mcron-jobs))) + (list (service-extension shepherd-root-service-type + log-cleanup-shepherd-services))) (description "Periodically delete old log files."))) From patchwork Fri Dec 13 22:58:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34881 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7B5FB27BBEA; Fri, 13 Dec 2024 23:02:51 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C849127BBE2 for ; Fri, 13 Dec 2024 23:02:50 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEff-0003xl-LV; Fri, 13 Dec 2024 18:02:08 -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 1tMEfb-0003wV-Vg for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfb-0002l9-HU; Fri, 13 Dec 2024 18:02:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=EpSyiz2tN3mFQnjdYouo4+8xssk+QQcrueQrjGy7xSs=; b=KQrVOzln3uElt8j3VTWmvkXyrQaerHsEqzOaV9gBfqZdDpO0Xk7fCOtyXgYK0wAn5568X+ATK7UkRkJyRKjudfRzNolbF1ANRr/akDZiQNWnau0ylq5Wd4gmXCzPOmHDD5eArrn4GQavW+V/QHIlPeC59CXE8keaKH809UUINNVZxsx2AHpdGhCNdxFTIxWtr5i8C0oUug/P1sH4UwZu9pDf/mDMSYJgsEuwGTFXbsem6uFDfZZXeIZfUbkKF+JSqu/7XmfKJ6IOLA2v+HWSWCZ52mrUmYVgNlrN49X64BP/WSC1RtPlpXC/GFgtQ0/NIu5Q+yslPpV0NVTL4RTq/w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfb-0001YM-BZ; Fri, 13 Dec 2024 18:02:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 04/10] services: unattended-upgrade: Rewrite as a Shepherd timer. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341308835800 (code B ref 74860); Fri, 13 Dec 2024 23:02:03 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:23 +0000 Received: from localhost ([127.0.0.1]:44558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEev-0001VM-Kr for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEep-0001UV-HE for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:16 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEcd-0001n0-PM; Fri, 13 Dec 2024 17:58:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=EpSyiz2tN3mFQnjdYouo4+8xssk+QQcrueQrjGy7xSs=; b=I/p9iU988aioNjko2uZe bRdxvE2GvM/CuSbZlqpTYTKxecNg/mKmK0fpgcFa1lKjDluIbiSJmqXpUfHVyvoegm+ZdY1gLj6hV RQjQ6s+7BOhZilG6dA2ZuiqtOa9Trf8tuOTOIn3sZdTAxI2x+osmA48CVtLddgHTXdZZi/+XCNc3i mG3Bxo+ZCHUV/Can7XbPL5rdhITRavj0Vu5cvINSeHHQcUWkV2jNL9oDdZ7v8t80X60YH0tIVEka3 RCx7PytBINP88rwDCROzeS8T5Z1rFuvzcfnaFyYNbmrAqZ7SKR22uq2s1Yx3eUhAVCxJOzg33F/EK xN9bY4ROLC1uCA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:24 +0100 Message-ID: <1ef30ffe4f1c8151279d93bd2331b4a21364b765.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This is a semi-incompatible change: gexps previously provided in the ‘schedule’ field will no longer work. * gnu/services/admin.scm (unattended-upgrade-mcron-jobs): Rename to… (unattended-upgrade-shepherd-services): … this. Return a list of one Shepherd service. Remove custom logging and time limitation facilities from ‘code’. (unattended-upgrade-service-type): Extend ‘shepherd-root-service-type’ instead of ‘mcron-service-type’. ()[services-to-restart]: Change default. * doc/guix.texi (Unattended Upgrades): Adjust ‘schedule’ and ‘services-to-restart’ documentation. Change-Id: I1b239c5946e71cf9e2af9b24fe4b01366b57fb7a Reviewed-by: Maxim Cournoyer --- doc/guix.texi | 13 ++++---- gnu/services/admin.scm | 69 +++++++++++++++++++++++------------------- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index e7784404d6..658081a9ed 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -23360,9 +23360,9 @@ Unattended Upgrades @table @asis @item @code{schedule} (default: @code{"30 01 * * 0"}) -This is the schedule of upgrades, expressed as a gexp containing an -mcron job schedule (@pxref{Guile Syntax, mcron job specifications,, -mcron, GNU@tie{}mcron}). +This is the schedule of upgrades, expressed as a string in traditional +cron syntax or as a gexp evaluating to a Shepherd calendar event +(@pxref{Timers,,, shepherd, The GNU Shepherd Manual}). @item @code{channels} (default: @code{#~%default-channels}) This gexp specifies the channels to use for the upgrade @@ -23411,7 +23411,7 @@ Unattended Upgrades rebooting. This means that the value for @code{services-to-restart} is ignored. The updated services will be started after the system reboots. -@item @code{services-to-restart} (default: @code{'(mcron)}) +@item @code{services-to-restart} (default: @code{'(unattended-upgrade)}) This field specifies the Shepherd services to restart when the upgrade completes. @@ -23426,8 +23426,9 @@ Unattended Upgrades @xref{Services}, for general information about services. Common services to restart would include @code{ntpd} and @code{ssh-daemon}. -By default, the @code{mcron} service is restarted. This ensures that -the latest version of the unattended upgrade job will be used next time. +By default, the @code{unattended-upgrade} service is restarted. This +ensures that the latest version of the unattended upgrade job will be +used next time. @item @code{system-expiration} (default: @code{(* 3 30 24 3600)}) This is the expiration time in seconds for system generations. System diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index aa1f56e90a..5fb2fcb6e0 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -517,7 +517,7 @@ (define-record-type* (reboot? unattended-upgrade-configuration-reboot? (default #f)) (services-to-restart unattended-upgrade-configuration-services-to-restart - (default '(mcron))) + (default '(unattended-upgrade))) (system-expiration unattended-upgrade-system-expiration (default (* 3 30 24 3600))) (maximum-duration unattended-upgrade-maximum-duration @@ -528,7 +528,7 @@ (define-record-type* (define %unattended-upgrade-log-file "/var/log/unattended-upgrade.log") -(define (unattended-upgrade-mcron-jobs config) +(define (unattended-upgrade-shepherd-services config) (define channels (scheme-file "channels.scm" (unattended-upgrade-configuration-channels config))) @@ -536,6 +536,9 @@ (define (unattended-upgrade-mcron-jobs config) (define log (unattended-upgrade-configuration-log-file config)) + (define schedule + (unattended-upgrade-configuration-schedule config)) + (define services (unattended-upgrade-configuration-services-to-restart config)) @@ -562,35 +565,17 @@ (define (unattended-upgrade-mcron-jobs config) #~(begin (use-modules (guix build utils) (gnu services herd) - (srfi srfi-19) (srfi srfi-34)) - (define log - (open-file #$log "a0")) - - (define (timestamp) - (date->string (time-utc->date (current-time time-utc)) - "[~4]")) - - (define (alarm-handler . _) - (format #t "~a time is up, aborting upgrade~%" - (timestamp)) - (exit 1)) + (setvbuf (current-output-port) 'line) + (setvbuf (current-error-port) 'line) ;; 'guix time-machine' needs X.509 certificates to authenticate the ;; Git host. (setenv "SSL_CERT_DIR" #$(file-append nss-certs "/etc/ssl/certs")) - ;; Make sure the upgrade doesn't take too long. - (sigaction SIGALRM alarm-handler) - (alarm #$(unattended-upgrade-maximum-duration config)) - - ;; Redirect stdout/stderr to LOG to save the output of 'guix' below. - (redirect-port log (current-output-port)) - (redirect-port log (current-error-port)) - - (format #t "~a starting upgrade...~%" (timestamp)) + (format #t "starting upgrade...~%") (guard (c ((invoke-error? c) (report-invoke-error c))) (apply invoke #$(file-append guix "/bin/guix") @@ -609,23 +594,45 @@ (define (unattended-upgrade-mcron-jobs config) (unless #$reboot? ;; Rebooting effectively restarts services anyway and execution ;; would be halted here if mcron is restarted. - (format #t "~a restarting services...~%" (timestamp)) + (format #t "restarting services...~%") (for-each restart-service '#$services)) - ;; XXX: If 'mcron' has been restarted, this is not reached. - (format #t "~a upgrade complete~%" (timestamp)) + ;; XXX: If this service has been restarted, this is not reached. + (format #t "upgrade complete~%") ;; Stopping the root shepherd service triggers a reboot. (when #$reboot? - (format #t "~a rebooting system~%" (timestamp)) + (format #t "rebooting system~%") (force-output) ;ensure the entire log is written. (stop-service 'root)))))) (define upgrade (program-file "unattended-upgrade" code)) - (list #~(job #$(unattended-upgrade-configuration-schedule config) - #$upgrade))) + (list (shepherd-service + (provision '(unattended-upgrade)) + (requirement '(user-processes networking)) + (modules '((shepherd service timer))) + (start #~(make-timer-constructor + #$(if (string? schedule) + #~(cron-string->calendar-event #$schedule) + schedule) + (command '(#$upgrade)) + + #:log-file #$log + + ;; Make sure the upgrade doesn't take too long. + #:max-duration + #$(unattended-upgrade-maximum-duration config) + + ;; Wait for the previous attempt to terminate before trying + ;; again. + #:wait-for-termination? #t)) + (stop #~(make-timer-destructor)) + (actions (list (shepherd-action + (name 'trigger) + (documentation "Trigger unattended system upgrade.") + (procedure #~trigger-timer))))))) (define (unattended-upgrade-log-rotations config) (list (log-rotation @@ -636,8 +643,8 @@ (define unattended-upgrade-service-type (service-type (name 'unattended-upgrade) (extensions - (list (service-extension mcron-service-type - unattended-upgrade-mcron-jobs) + (list (service-extension shepherd-root-service-type + unattended-upgrade-shepherd-services) (service-extension rottlog-service-type unattended-upgrade-log-rotations))) (description From patchwork Fri Dec 13 22:58:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34883 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0084A27BBE9; Fri, 13 Dec 2024 23:02:54 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AD42A27BBE2 for ; Fri, 13 Dec 2024 23:02:53 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEfe-0003xV-Tt; Fri, 13 Dec 2024 18:02:07 -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 1tMEfc-0003wW-AH for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfc-0002lO-16; Fri, 13 Dec 2024 18:02:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=aQT20oEnxny2I+U1U05ORQ8cjovS/fYo4JBL0gDP61Y=; b=ltQSHLAXcdgg6291T6EAcaaHW/vhawiog+6XqLppbsmlvBoZVSa+zbXndC02HL+qnlRPFp9xgVQ1xtq2NVfmKSONKahMavJCoaGXcCcpsk6bbyXuwb+Sn9mv3d/fP8Ogq1ofHapj5lQaO0nRERRTgHMJojKY9QlA8ciZ1eesInLXlx+2YKoeOdOPBP33uoqVHKx/MbtS94jamjXPyI+O4KQS7tOpsXlrFSGUJNCJV3mejWcJ0PBCeXQxNeilL0SSJqgalC9o1iIQLmErw7s3NoVUTphdJY2siq7AnY41FIZM7c/TtxOlpDDv4YKmjThw+k0H88wbzIyWCKt+88RJSw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfb-0001YX-R6; Fri, 13 Dec 2024 18:02:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 05/10] services: Switch from mcron + Rottlog to =?utf-8?b?U2hlcGhlcmTigJlz?= log rotation. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341308935838 (code B ref 74860); Fri, 13 Dec 2024 23:02:03 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:33 +0000 Received: from localhost ([127.0.0.1]:44566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEf6-0001W2-09 for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEf3-0001Vd-Rs for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:31 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEcq-0001o7-Cb; Fri, 13 Dec 2024 17:59:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=aQT20oEnxny2I+U1U05ORQ8cjovS/fYo4JBL0gDP61Y=; b=F8d1c/HgUIWBueCDTGvo 24eiGKIN25GaVy9a0GhVTRV9l6B0opIpVY1N1IPRpSVCGWEGFgiWvQUUBPkysDjpL8yPg9woMvWql PjiIa+I93LyDG5s4y9rLtPW5Mq4tUhpW4BCHe3QGU1IX2TT+xiCz/P5d878htwmn49BXENhhNImen pCnDM/P7z2KmfA6ey4OgqKi5yvEziQyOrCVRCfje/MWCy9+AM0sq7SvjwIG2OcswwjODvgRiAL2vw e16OKG8vsyrT+Nme0m/r8xtQ8NNc2jnDPAMrwCjKR6ohQXH549x5UYqVTFWMMyQ6HDyoJ0hgzHGc/ As8dGXjoIHofxw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:25 +0100 Message-ID: <996235434e14dd004d6ff36228e755aaf3451d9b.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/admin.scm (unattended-upgrade-log-rotations): Remove. (unattended-upgrade-service-type): Remove ‘rottlog-service-type’ extension. * gnu/services/audio.scm (mpd-log-rotation): Remove. (mpd-service-type): Remove ‘rottlog-service-type’ extension. (mympd-log-rotation): Remove. (mympd-service-type): Remove rottlog-service-type’ extension. * gnu/services/base.scm (%guix-publish-log-rotations): Remove. (guix-publish-service-type): Remove ‘rottlog-service-type’ extension. (%base-services): Instantiate ‘log-rotation-service-type’ instead of ‘rottlog-service-type’. * gnu/services/cuirass.scm (cuirass-log-rotations): Remove. (cuirass-service-type): Remove ‘rottlog-service-type’ extension. (cuirass-remote-worker-log-rotations): Remove. (cuirass-remote-worker-service-type): Remove ‘rottlog-service-type’ extension. * gnu/services/file-sharing.scm (%transmission-daemon-log-rotations): Remove. (transmission-daemon-service-type): Remove ‘rottlog-service-type’ extension. * gnu/services/linux.scm (%earlyoom-log-rotation): Remove. (earlyoom-service-type): Remove ‘rottlog-service-type’ extension. * gnu/services/networking.scm (%ntp-log-rotation): Remove. (ntp-service-type): Remove ‘rottlog-service-type’ extension. (openntpd-service-type): Likewise. (%connman-log-rotation): Remove. (connman-service-type): Remove ‘rottlog-service-type’ extension. (%hostapd-log-rotation): Remove. (hostapd-service-type): Remove ‘rottlog-service-type’ extension. (%pagekite-log-rotation): Remove. (pagekite-service-type): Remove ‘rottlog-service-type’ extension. (%yggdrasil-log-rotation): Remove. (yggdrasil-service-type): Remove ‘rottlog-service-type’ extension. (%ipfs-log-rotation): Remove. (ipfs-service-type): Remove ‘rottlog-service-type’ extension. (%keepalived-log-rotation): Remove. (keepalived-service-type): Remove ‘rottlog-service-type’ extension. * gnu/services/web.scm (%hpcguix-web-log-rotations): Remove. (hpcguix-web-service-type): Remove ‘rottlog-service-type’ extension. (%mumi-log-rotations): Remove. (mumi-service-type): Remove ‘rottlog-service-type’ extension. * doc/guix.texi (Log Rotation): Adjust text regarding which one is in ‘%base-services’. Change-Id: I8802d4c2337a1e08e3c084d6217f76527d7ee1fb --- doc/guix.texi | 5 +-- gnu/services/admin.scm | 9 +----- gnu/services/audio.scm | 26 ++------------- gnu/services/base.scm | 10 +----- gnu/services/cuirass.scm | 27 +--------------- gnu/services/file-sharing.scm | 6 ---- gnu/services/linux.scm | 8 +---- gnu/services/networking.scm | 61 +++++------------------------------ gnu/services/web.scm | 17 +--------- 9 files changed, 18 insertions(+), 151 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 658081a9ed..952248f2a0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20795,6 +20795,9 @@ Log Rotation log-rotation} and trigger rotation manually with @command{herd trigger log-rotation}. +This service is part of @code{%base-services}, and thus enabled by +default, with the default settings. + @defvar log-rotation-service-type This is the type of the log rotation service. Its associated value must be a @code{log-rotation-configuration} record, as discussed below. @@ -20838,8 +20841,6 @@ Log Rotation rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}), is also provided. -This service is part of @code{%base-services}, and thus enabled by -default, with the default settings, for commonly encountered log files. The example below shows how to extend it with an additional @dfn{rotation}, should you need to do that (usually, services that produce log files already take care of that): diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 5fb2fcb6e0..7f570f67e4 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -634,19 +634,12 @@ (define (unattended-upgrade-shepherd-services config) (documentation "Trigger unattended system upgrade.") (procedure #~trigger-timer))))))) -(define (unattended-upgrade-log-rotations config) - (list (log-rotation - (files - (list (unattended-upgrade-configuration-log-file config)))))) - (define unattended-upgrade-service-type (service-type (name 'unattended-upgrade) (extensions (list (service-extension shepherd-root-service-type - unattended-upgrade-shepherd-services) - (service-extension rottlog-service-type - unattended-upgrade-log-rotations))) + unattended-upgrade-shepherd-services))) (description "Periodically upgrade the system from the current configuration.") (default-value (unattended-upgrade-configuration)))) diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index 5d2cd56a17..6515d53dbd 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -579,17 +579,6 @@ (define (mpd-serialize-configuration configuration) "mpd.conf" (serialize-configuration configuration mpd-configuration-fields))) -(define (mpd-log-rotation config) - (match-record config - (log-file) - (if (string=? "syslog" log-file) - '() ;nothing to do - (list (log-rotation - (files (list log-file)) - (post-rotate #~(begin - (use-modules (gnu services herd)) - (with-shepherd-action 'mpd ('reopen) #f)))))))) - (define (mpd-shepherd-service config) (match-record config (user package shepherd-requirement @@ -675,8 +664,7 @@ (define mpd-service-type (extensions (list (service-extension shepherd-root-service-type (compose list mpd-shepherd-service)) - (service-extension account-service-type mpd-accounts) - (service-extension rottlog-service-type mpd-log-rotation))) + (service-extension account-service-type mpd-accounts))) (default-value (mpd-configuration)))) @@ -953,14 +941,6 @@ (define (mympd-accounts config) user))) (list user group)))) -(define (mympd-log-rotation config) - (match-record config - (log-to) - (if (maybe-value-set? log-to) - (list (log-rotation - (files (list log-to)))) - '()))) - (define mympd-service-type (service-type (name 'mympd) @@ -970,8 +950,6 @@ (define mympd-service-type (service-extension account-service-type mympd-accounts) (service-extension special-files-service-type - mympd-serialize-configuration) - (service-extension rottlog-service-type - mympd-log-rotation))) + mympd-serialize-configuration))) (description "Run myMPD, a frontend for MPD. (Music Player Daemon)") (default-value (mympd-configuration)))) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 6473e1a91a..0a2b7e069d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2297,12 +2297,6 @@ (define %guix-publish-accounts (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) -(define %guix-publish-log-rotations - (list (log-rotation - (files (list "/var/log/guix-publish.log")) - (options `("rotate 4" ;don't keep too many of them - ,@%default-log-rotation-options))))) - (define (guix-publish-activation config) (let ((cache (guix-publish-configuration-cache config))) (if cache @@ -2324,8 +2318,6 @@ (define guix-publish-service-type guix-publish-shepherd-service) (service-extension account-service-type (const %guix-publish-accounts)) - (service-extension rottlog-service-type - (const %guix-publish-log-rotations)) (service-extension activation-service-type guix-publish-activation))) (default-value (guix-publish-configuration)) @@ -3679,7 +3671,7 @@ (define %base-services (service guix-service-type) (service nscd-service-type) - (service rottlog-service-type) + (service log-rotation-service-type) ;; Periodically delete old build logs. (service log-cleanup-service-type diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index cc5cd62672..6643fd2f35 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -331,20 +331,6 @@ (define (cuirass-activation config) (when #$remote-cache (chown #$remote-cache uid gid))))))) -(define (cuirass-log-rotations config) - "Return the list of log rotations that corresponds to CONFIG." - (list (log-rotation - (files (append (list (cuirass-configuration-log-file config) - (cuirass-configuration-web-log-file config)) - (let ((server - (cuirass-configuration-remote-server config))) - (if server - (list (cuirass-remote-server-log-file server)) - '())))) - (frequency 'weekly) - (options `("rotate 40" ;worth keeping - ,@%default-log-rotation-options))))) - (define cuirass-service-type (service-type (name 'cuirass) @@ -352,7 +338,6 @@ (define cuirass-service-type (list (service-extension profile-service-type ;for 'info cuirass' (compose list cuirass-configuration-cuirass)) - (service-extension rottlog-service-type cuirass-log-rotations) (service-extension activation-service-type cuirass-activation) (service-extension shepherd-root-service-type cuirass-shepherd-service) (service-extension account-service-type cuirass-account) @@ -445,14 +430,6 @@ (define (cuirass-remote-worker-shepherd-service config) #:log-file #$log-file)) (stop #~(make-kill-destructor)))))) -(define (cuirass-remote-worker-log-rotations config) - "Return the list of log rotations that corresponds to CONFIG." - (list (log-rotation - (files (list (cuirass-remote-worker-log-file config))) - (frequency 'weekly) - (options `("rotate 4" ;don't keep too many of them - ,@%default-log-rotation-options))))) - (define cuirass-remote-worker-service-type (service-type (name 'cuirass-remote-worker) @@ -460,8 +437,6 @@ (define cuirass-remote-worker-service-type (list (service-extension shepherd-root-service-type cuirass-remote-worker-shepherd-service) (service-extension account-service-type - (const %cuirass-remote-worker-accounts)) - (service-extension rottlog-service-type - cuirass-remote-worker-log-rotations))) + (const %cuirass-remote-worker-accounts)))) (description "Run the Cuirass remote build worker service."))) diff --git a/gnu/services/file-sharing.scm b/gnu/services/file-sharing.scm index 75e99f20b7..6b25cd420f 100644 --- a/gnu/services/file-sharing.scm +++ b/gnu/services/file-sharing.scm @@ -701,10 +701,6 @@ (define %transmission-daemon-accounts (shell (file-append shadow "/sbin/nologin")) (system? #t)))) -(define %transmission-daemon-log-rotations - (list (log-rotation - (files (list %transmission-daemon-log-file))))) - (define (transmission-daemon-computed-settings-file config) "Return a @code{computed-file} object that, when unquoted in a G-expression, produces a Transmission settings file (@file{settings.json}) matching CONFIG." @@ -785,8 +781,6 @@ (define transmission-daemon-service-type transmission-daemon-shepherd-service) (service-extension account-service-type (const %transmission-daemon-accounts)) - (service-extension rottlog-service-type - (const %transmission-daemon-log-rotations)) (service-extension activation-service-type transmission-daemon-activation))) (default-value (transmission-daemon-configuration)) diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm index 9955a11e64..e683da6bac 100644 --- a/gnu/services/linux.scm +++ b/gnu/services/linux.scm @@ -181,19 +181,13 @@ (define (earlyoom-shepherd-service config) #:log-file "/var/log/earlyoom.log")) (stop #~(make-kill-destructor)))) -(define %earlyoom-log-rotation - (list (log-rotation - (files '("/var/log/earlyoom.log"))))) - (define earlyoom-service-type (service-type (name 'earlyoom) (default-value (earlyoom-configuration)) (extensions (list (service-extension shepherd-root-service-type - (compose list earlyoom-shepherd-service)) - (service-extension rottlog-service-type - (const %earlyoom-log-rotation)))) + (compose list earlyoom-shepherd-service)))) (description "Run @command{earlyoom}, a daemon that quickly responds to @acronym{OOM, out-of-memory} conditions by terminating relevant processes."))) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 76563be14f..44e93ebddf 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -496,11 +496,6 @@ (define dhcpd-service-type ;;; NTP. ;;; - -(define %ntp-log-rotation - (list (log-rotation - (files '("/var/log/ntpd.log"))))) - (define ntp-server-types (make-enumeration '(pool server @@ -634,9 +629,7 @@ (define ntp-service-type (service-extension account-service-type (const %ntp-accounts)) (service-extension activation-service-type - ntp-service-activation) - (service-extension rottlog-service-type - (const %ntp-log-rotation)))) + ntp-service-activation))) (description "Run the @command{ntpd}, the Network Time Protocol (NTP) daemon of the @uref{http://www.ntp.org, Network Time Foundation}. The daemon @@ -745,9 +738,7 @@ (define openntpd-service-type (service-extension profile-service-type (compose list openntpd-configuration-openntpd)) (service-extension activation-service-type - openntpd-service-activation) - (service-extension rottlog-service-type - (const %ntp-log-rotation)))) + openntpd-service-activation))) (default-value (openntpd-configuration)) (description "Run the @command{ntpd}, the Network Time Protocol (NTP) @@ -1699,10 +1690,6 @@ (define (connman-shepherd-service config) #:log-file "/var/log/connman.log")) (stop #~(make-kill-destructor))))))) -(define %connman-log-rotation - (list (log-rotation - (files '("/var/log/connman.log"))))) - (define connman-service-type (let ((connman-package (compose list connman-configuration-connman))) (service-type (name 'connman) @@ -1717,9 +1704,7 @@ (define connman-service-type connman-activation) ;; Add connman to the system profile. (service-extension profile-service-type - connman-package) - (service-extension rottlog-service-type - (const %connman-log-rotation)))) + connman-package))) (default-value (connman-configuration)) (description "Run @url{https://01.org/connman,Connman}, @@ -1960,18 +1945,12 @@ (define* (hostapd-shepherd-services config #:key (requirement '())) #:log-file "/var/log/hostapd.log")) (stop #~(make-kill-destructor))))) -(define %hostapd-log-rotation - (list (log-rotation - (files '("/var/log/hostapd.log"))))) - (define hostapd-service-type (service-type (name 'hostapd) (extensions (list (service-extension shepherd-root-service-type - hostapd-shepherd-services) - (service-extension rottlog-service-type - (const %hostapd-log-rotation)))) + hostapd-shepherd-services))) (description "Run the @uref{https://w1.fi/hostapd/, hostapd} daemon for Wi-Fi access points and authentication servers."))) @@ -2271,10 +2250,6 @@ (define (pagekite-shepherd-service config) ;; SIGTERM doesn't always work for some reason. (stop #~(make-kill-destructor SIGINT)))))) -(define %pagekite-log-rotation - (list (log-rotation - (files '("/var/log/pagekite.log"))))) - (define %pagekite-accounts (list (user-group (name "pagekite") (system? #t)) (user-account @@ -2293,9 +2268,7 @@ (define pagekite-service-type (list (service-extension shepherd-root-service-type (compose list pagekite-shepherd-service)) (service-extension account-service-type - (const %pagekite-accounts)) - (service-extension rottlog-service-type - (const %pagekite-log-rotation)))) + (const %pagekite-accounts)))) (description "Run @url{https://pagekite.net/,PageKite}, a tunneling solution to make local servers publicly accessible on the web, even behind NATs and firewalls."))) @@ -2386,10 +2359,6 @@ (define (yggdrasil-shepherd-service config) #:group "yggdrasil")) (stop #~(make-kill-destructor))))) -(define %yggdrasil-log-rotation - (list (log-rotation - (files '("/var/log/yggdrasil.log"))))) - (define %yggdrasil-accounts (list (user-group (name "yggdrasil") (system? #t)))) @@ -2405,9 +2374,7 @@ (define yggdrasil-service-type (service-extension account-service-type (const %yggdrasil-accounts)) (service-extension profile-service-type - (compose list yggdrasil-configuration-package)) - (service-extension rottlog-service-type - (const %yggdrasil-log-rotation)))))) + (compose list yggdrasil-configuration-package)))))) ;;; @@ -2477,10 +2444,6 @@ (define (ipfs-shepherd-service config) #:environment-variables #$%ipfs-environment)) (stop #~(make-kill-destructor))))) -(define %ipfs-log-rotation - (list (log-rotation - (files '("/var/log/ipfs.log"))))) - (define (%ipfs-activation config) "Return an activation gexp for IPFS with CONFIG" (define (exec-command . args) @@ -2536,9 +2499,7 @@ (define ipfs-service-type (service-extension activation-service-type %ipfs-activation) (service-extension shepherd-root-service-type - ipfs-shepherd-service) - (service-extension rottlog-service-type - (const %ipfs-log-rotation)))) + ipfs-shepherd-service))) (default-value (ipfs-configuration)) (description "Run @command{ipfs daemon}, the reference implementation @@ -2574,16 +2535,10 @@ (define (keepalived-shepherd-service config) (respawn? #f) (stop #~(make-kill-destructor)))))) -(define %keepalived-log-rotation - (list (log-rotation - (files '("/var/log/keepalived.log"))))) - (define keepalived-service-type (service-type (name 'keepalived) (extensions (list (service-extension shepherd-root-service-type - keepalived-shepherd-service) - (service-extension rottlog-service-type - (const %keepalived-log-rotation)))) + keepalived-shepherd-service))) (description "Run @uref{https://www.keepalived.org/, Keepalived} routing software."))) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 3997fe2ab8..c6b2b7fc23 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -1245,11 +1245,6 @@ (define %hpcguix-web-activation (define %hpcguix-web-log-file "/var/log/hpcguix-web.log") -(define %hpcguix-web-log-rotations - (list (log-rotation - (files (list %hpcguix-web-log-file)) - (frequency 'weekly)))) - (define (hpcguix-web-shepherd-service config) (let* ((specs (hpcguix-web-configuration-specs config)) (config-file (and specs (scheme-file "hpcguix-web.scm" specs))) @@ -1287,8 +1282,6 @@ (define hpcguix-web-service-type (const %hpcguix-web-accounts)) (service-extension activation-service-type (const %hpcguix-web-activation)) - (service-extension rottlog-service-type - (const %hpcguix-web-log-rotations)) (service-extension shepherd-root-service-type (compose list hpcguix-web-shepherd-service)))) (default-value (hpcguix-web-configuration)))) @@ -2084,12 +2077,6 @@ (define (mumi-shepherd-services config) #:log-file #$%mumi-mailer-log)) (stop #~(make-kill-destructor))))))) -(define %mumi-log-rotations - (list (log-rotation - (files (list %mumi-log - %mumi-mailer-log - %mumi-worker-log))))) - (define mumi-service-type (service-type (name 'mumi) @@ -2099,9 +2086,7 @@ (define mumi-service-type (service-extension account-service-type (const %mumi-accounts)) (service-extension shepherd-root-service-type - mumi-shepherd-services) - (service-extension rottlog-service-type - (const %mumi-log-rotations)))) + mumi-shepherd-services))) (description "Run Mumi, a Web interface to the Debbugs bug-tracking server.") (default-value From patchwork Fri Dec 13 22:58:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34887 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0F18527BBEA; Fri, 13 Dec 2024 23:03:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BA2DE27BBE2 for ; Fri, 13 Dec 2024 23:03:14 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEfr-00041c-GA; Fri, 13 Dec 2024 18:02:19 -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 1tMEff-0003xk-5d for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfe-0002lU-MV; Fri, 13 Dec 2024 18:02:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=p8WLl6n0QXS5oQSdXyAVSmRjiDIqj84jtXMYd6CV1/k=; b=JCFY0jcwaDFvENgwnK1NsX3NovontOqZn+G0ECekmg9fdBdtBBkzC2+pkJil6Ok19T4a/Jvuva7IYPPHryTpJHGBs7HSwKEZ/5xQ/yGcFXUEnD2s4AqgDfh7BgWC51lfCuBVmR/IVVsC48e8AsLzL1PgZpHetLH3bBpCfcxgA+3pBU8TZcMHNadI04L0BF26lmhhSUp/4qMuv6G1eR4thOp/91Pwhdv8q/3BkQXqpwHAwG+YDqg3jk4WihtB+S3SsPRZhon3hRS4bXP5P/tV6v0yr4rhF8HIUuMY4ePx7zroSQ/xHCPtydf1B181Ns4E2/pvyS1vzw8p8W4q86ZAkg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfc-0001Yf-Ad; Fri, 13 Dec 2024 18:02:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 06/10] services: rottlog: Deprecate. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341308955853 (code B ref 74860); Fri, 13 Dec 2024 23:02:04 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:35 +0000 Received: from localhost ([127.0.0.1]:44571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEf9-0001WL-8n for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEf7-0001Vi-V6 for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:34 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEcv-0001oQ-IB; Fri, 13 Dec 2024 17:59:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=p8WLl6n0QXS5oQSdXyAVSmRjiDIqj84jtXMYd6CV1/k=; b=qM5uzPaHUmJVFujNXp7k cQn3hZ+K1xUZwQNbJYnwWkvRnzYpD0twb+gVgdc6r7fQf26dcIYOy39pIAAg0nNy5UhRX/y7yVJs5 JJ0aKvr4T1fVsEEDyieDJS+NGvQ3btrIwNZIDS45uPNyM/yRGstDr+2Hhk1zSb+nYTH+XgCujfG+P mT95dyfX1dgy9t2F5GQ5Bg9t3pE592XrDuP5H7NWMJQoLwbCk41VuL/e054MOrudqqyohl3JbFzwI gGGCPWk9w5nq1M6w3B/OGZIYSaFCfjBrMmHSX+oSnLTwmoiN3Fgf5HEoRGk7CuGqeQ06Nd9wI7Ara QDCdd7EjqvPmnQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:26 +0100 Message-ID: <2b01f136b17b98ec6f9c4a5eb0f7c65ea50f9cea.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/admin.scm (rottlog-service-type): Deprecate. * doc/guix.texi (Log Rotation): Add deprecation warning. Change-Id: I661666ff3de64a69ff4f4982d7f432fd575c36df --- doc/guix.texi | 7 +++++++ gnu/services/admin.scm | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 952248f2a0..1df1ccc649 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20841,6 +20841,13 @@ Log Rotation rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}), is also provided. +@quotation Warning +The Rottlog service presented here is deprecated in favor of +@code{log-rotation-service-type} (see above). The +@code{rottlog-service-type} variable and related tools will be removed +after 2025-05-15. +@end quotation + The example below shows how to extend it with an additional @dfn{rotation}, should you need to do that (usually, services that produce log files already take care of that): diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 7f570f67e4..5d585959a0 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -32,6 +32,7 @@ (define-module (gnu services admin) #:use-module (gnu system accounts) #:use-module ((gnu system shadow) #:select (account-service-type)) #:use-module ((guix store) #:select (%store-prefix)) + #:use-module (guix deprecation) #:use-module (guix gexp) #:use-module (guix modules) #:use-module (guix packages) @@ -298,7 +299,9 @@ (define (rottlog-jobs-or-default config) (or (rottlog-configuration-jobs config) (default-jobs (rottlog-configuration-rottlog config)))) -(define rottlog-service-type +;; TODO: Deprecated; remove sometime after 2025-05-15. +(define-deprecated rottlog-service-type + log-rotation-service-type (service-type (name 'rottlog) (description From patchwork Fri Dec 13 22:58:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34885 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7B1BE27BBE2; Fri, 13 Dec 2024 23:03:07 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 23BFC27BBE2 for ; Fri, 13 Dec 2024 23:03:07 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEfn-0003zZ-6b; Fri, 13 Dec 2024 18:02:15 -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 1tMEfe-0003xX-MS for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfe-0002lw-61 for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=Xnx/gieQ1rXR4pVHSnfUJ06HrukMBU4PizXVDAPqNn4=; b=Sf8i4f+jPRQheTbbf6ooZhKYkJWcQW6RFzTasBrANojQiSao/yV4V0ITqiANzWzAIoLi00HAYjwSCi6KsLOU2xBIKyov33SQv+XlPXOKnefejMDl9JiJyuKVsRvJBrOPYGOzZpUFsKLYZ8CuJuz6pQfxYlZ52D0bpUroP5xk6jLpLLMo2JR2N1Y4pnRJUckgUSfRrPBJ66vMAh9+T8KL1sMD89ocSMnd5u5sgs8IxUkCb+HEMHLP595+F+aaXCqUO5JY7GEEABHWKMpM3pTVuOJvDP2MLKpEoZ5XVXp49iakU1AyNoBqR7Mf3nI0iTuWf2tMkI3qejSMfcXq87hFVg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfc-0001Yn-QD; Fri, 13 Dec 2024 18:02:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 07/10] DRAFT news: Add entry for =?utf-8?b?4oCY?= =?utf-8?b?cm90dGxvZy1zZXJ2aWNlLXR5cGXigJk=?= deprecation. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, julien@lepiller.eu, guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Florian Pelz , Julien Lepiller X-Debbugs-Original-Xcc: Florian Pelz , Julien Lepiller Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341309005872 (code B ref 74860); Fri, 13 Dec 2024 23:02:04 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:40 +0000 Received: from localhost ([127.0.0.1]:44575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEfD-0001Wc-LV for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEfA-0001Vr-0g for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:36 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEcy-0001oc-EG; Fri, 13 Dec 2024 17:59:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Xnx/gieQ1rXR4pVHSnfUJ06HrukMBU4PizXVDAPqNn4=; b=B8UAsVynwOR5Sc/0czKy V2Kj06kI/0OE4cKPUmm8u2qPpi1rwQn1xs6pmZ969YFhScUl7jr/muICGfsBqVyn+XWxPrdHBydAO oG0GXxoeBXPaltCD71cj4gMjW6McAbie9T18LAKGJ7dXH8aTMhuCaxDBEeP5BIyrQnNbLS3sXyOOe RbFC991AbEX78lgpAP4nu6+/1Z0C+TP8LrRwN+MxpNEXKejOatcX9ef85ZCFvIpRx79Mg21Aby1EG JVyGAnv3zR4qRnlGtUEZbwOZrKorRb/+AMLPQdtS7+2yPItBzW6O9q73K176o6ZRDMwqRvCNFSDEJ /d2wlgwHwODv8A==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:27 +0100 Message-ID: <80cf8827df776a9bed687aa7ab30f932196ec049.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * etc/news.scm: Add entry. Change-Id: I46ccddf4216b4c46ec417692c832b2e37a3669a0 --- etc/news.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/etc/news.scm b/etc/news.scm index 0628b0fdb4..101f390ed2 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -34,6 +34,25 @@ (channel-news (version 0) + + (entry (commit "FIXME") + (title + (en "Rottlog service replaced by new log rotation service")) + (body + (en "A noticeable change was made that impacts all Guix System users: +the Rottlog service was replaced by the new log rotation service. +Additionally, @code{rottlog-service-type} is now deprecated in favor of +@code{log-rotation-service-type} and will be removed in six months, in +accordance with the project's deprecation policy. + +The new @code{log-rotation-service-type} builds upon the log rotation service +provided by version 1.0 of the Shepherd. It is more flexible and easier to +use. Run @command{info \"(guix) Log Rotation\"}, for more info. + +Because the new log rotation service depends on Shepherd 1.0 functionality, +you will need to reboot after reconfiguring if you are not running Shepherd +1.0 yet."))) + (entry (commit "ccf72d5074b0c5ba793e686cbb1d6eaad39824bf") (title (de "Neues Format @samp{appimage} für den Befehl @command{guix pack}") From patchwork Fri Dec 13 22:58:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34879 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BFD7027BBE2; Fri, 13 Dec 2024 23:02:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 95B6127BBE9 for ; Fri, 13 Dec 2024 23:02:35 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEfi-0003z3-Vs; Fri, 13 Dec 2024 18:02:11 -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 1tMEfe-0003xL-1L for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfd-0002lf-MG for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=P8tnYTndckonVRpLT3Q2ijBSorv/4zbJjKSmNAUiqW8=; b=qejToSr2YeFw9mwLQdbcVQCg9+JCmdWwSwA91JzG5V8S6qrTfOaMhD0W+4WlXxQp9WOGp483NHLuswlQ/85izPhVp+UTA1RcV2u6pC+OcUEUCTmqgLj1IlIg8iV2ovuJv/2Et32vKSyjmQecuWBpBhOtgd57JcIbNWNr7AS/IQ+9QwCPywbq7wCZ6Ghp0qOwrTWLclAkdyvrJtYC/RZ2MZo5NkZtSm16T61p3sSpetf4kXa3//0tNiz6ivpOumUelPJ2LFLOubme2ocHs837roRitJn2bSik7Z/GfHcYyIc+F2T5PylRIlMP3SIIAI0BcjpDnCfoctmA64HXq+ZfWQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfd-0001Yu-9u for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 08/10] home: services: Add log rotation service. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , ( , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer , Tanguy Le Carrour X-Debbugs-Original-Xcc: ( , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer , Tanguy Le Carrour Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341309125912 (code B ref 74860); Fri, 13 Dec 2024 23:02:05 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:52 +0000 Received: from localhost ([127.0.0.1]:44581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEfL-0001X2-3l for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEfI-0001Wa-6a for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEd5-0001p2-94; Fri, 13 Dec 2024 17:59:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=P8tnYTndckonVRpLT3Q2ijBSorv/4zbJjKSmNAUiqW8=; b=ByNTTeElzg12c56Nn5VY u3rasnjpPqwCZhCu+7HsKA5hSuFkRaF+/HdZM5HCor1+bvoWGEoz7mdKf2b81+gFyXI4fSSa2Y3wE /lMkyYnH2AUsPf8d9C3IMuIrfZEbhqdpUHbd25npJ5w5iBZTds9SIWqtc8GKU8WimnzH//buLBptv kpKr/uHgvri+jogs4TyL17HA7MBhKLorwHpCAZ6rNTXum1gN/5cZvG5bdfFQqBXsG0NPEfDzp0h4l 8Vpid4K1CkfqTZcU5BOlk+6ORjQSkIO9tXex0VIUPs/OJ7dwem9iAudxw/dWlHbyVIZRlnHil+hAk fmVnCUMtjh/5Xw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:28 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/home/services/admin.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi (Shepherd Home Service): Document it. Change-Id: I37ac171147c236b05d6d3b226e9072ab7524dfe9 --- doc/guix.texi | 15 +++++++++++++++ gnu/home/services/admin.scm | 31 +++++++++++++++++++++++++++++++ gnu/local.mk | 1 + 3 files changed, 47 insertions(+) create mode 100644 gnu/home/services/admin.scm diff --git a/doc/guix.texi b/doc/guix.texi index 1df1ccc649..788a9b4957 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20803,6 +20803,7 @@ Log Rotation be a @code{log-rotation-configuration} record, as discussed below. @end defvar +@anchor{log-rotation-configuration} @deftp {Data Type} log-rotation-configuration This data type represents the configuration of the log rotation service. Its defaults should be good for most use cases. @@ -46587,6 +46588,20 @@ Shepherd Home Service @end table @end deftp +@cindex log rotation, for user services +The Shepherd also comes with a @dfn{log rotation service}, which +compresses and then deletes old log files produced by services and +daemons that it runs. This service is made available through +@code{home-log-rotation-service-type} as described below. + +@defvar home-log-rotation-service-type +This is the service type for the user Shepherd log rotation service +(@pxref{Log Rotation Service,,, shepherd, The GNU Shepherd Manual}). +Its value must be a @code{log-rotation-configuration} record, exactly as +for its system-wide counterpart. @xref{log-rotation-configuration}, for +its reference. +@end defvar + @node Secure Shell @subsection Secure Shell diff --git a/gnu/home/services/admin.scm b/gnu/home/services/admin.scm new file mode 100644 index 0000000000..1cd398cc51 --- /dev/null +++ b/gnu/home/services/admin.scm @@ -0,0 +1,31 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Ludovic Courtès +;;; +;;; 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 . + +(define-module (gnu home services admin) + #:use-module (gnu home services) + #:use-module (gnu services) + #:use-module (gnu services admin) + ;; For the 'home-shepherd-service-type' mapping. + #:use-module (gnu home services shepherd) + #:export (home-log-rotation-service-type) + #:re-export (log-rotation-configuration)) + +(define home-log-rotation-service-type + (service-type + (inherit (system->home-service-type log-rotation-service-type)) + (default-value (for-home (log-rotation-configuration))))) diff --git a/gnu/local.mk b/gnu/local.mk index 39b142af5a..d96fa61dc4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -100,6 +100,7 @@ GNU_SYSTEM_MODULES = \ %D%/compression.scm \ %D%/home.scm \ %D%/home/services.scm \ + %D%/home/services/admin.scm \ %D%/home/services/desktop.scm \ %D%/home/services/dict.scm \ %D%/home/services/dotfiles.scm \ From patchwork Fri Dec 13 22:58:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34886 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E13AF27BBE2; Fri, 13 Dec 2024 23:03:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4CC8427BBE9 for ; Fri, 13 Dec 2024 23:03:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEfp-000411-T5; Fri, 13 Dec 2024 18:02:17 -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 1tMEfe-0003xP-7e for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfd-0002lq-V2 for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=+2gPvczJFnNN2oQuMFt3e9qxGVNvwBg/mgmUT8a0MDo=; b=Jaldg9lNZiANVbFjJDxJ63eA6Q3KgHJwJOanySUftaYWTEjToVcEAyQA8duLp0aIE/95FScReAciekG/DihvFPyZ/T+xhTkiDaepkgXfDnuvR4QbpjLYFCrKg0SbImMBz5417tQXLOrhf9kUdjV59riFtUkLJ8l7agB1L5Sh4XS2Kb0GDS0SbhGfMQd+KFlIOSIAVS2Z55bxlb0VVkTyAufzzo8ngi1iSnnadz/PLXGROUOJmjzcC7U4NG4pVZuujEf8U2GLzRE3zZRLb7o5YGSJ4b9ZdDgfH8sqHPPpnurkJ8WX0ZurErDhIERfZAi+O9v+f5uuEahh95a68pFR7A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfd-0001Z1-Px for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 09/10] home: Define =?utf-8?b?4oCYJWJhc2UtaG9t?= =?utf-8?b?ZS1zZXJ2aWNlc+KAmS4=?= Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , ( , Andrew Tropin , Christopher Baines , Janneke Nieuwenhuizen , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Maxim Cournoyer , Simon Tournier , Tanguy Le Carrour , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: ( , Andrew Tropin , Christopher Baines , Janneke Nieuwenhuizen , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Maxim Cournoyer , Simon Tournier , Tanguy Le Carrour , Tobias Geerinckx-Rice Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341309155923 (code B ref 74860); Fri, 13 Dec 2024 23:02:05 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:55 +0000 Received: from localhost ([127.0.0.1]:44585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEfQ-0001XO-7E for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEfK-0001Wm-88 for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:47 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEd9-0001pd-Ll; Fri, 13 Dec 2024 17:59:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=+2gPvczJFnNN2oQuMFt3e9qxGVNvwBg/mgmUT8a0MDo=; b=Iu6GZ8iuxqVPodkXoBB8 B6lRVVzvCKbWKoFRXuZQRrom4WoOpGAwxuQHFBiWZA9+hMOEnOwfJay3aUYfluKyjSdw4hoiUNw+S rbIc+g5iZ14I92rkRNfUYJA1A7EcVyzyLJhHCrBl2sAfIGl0VwD1yZ3Am3mwKQy8Rq8OOWapgwnhf uGtzdzKM5oMtwgFWpNEYzKP9Sq/H/278PKiHcDaQu2bxcZuj2d/RHzEAkXyLfSD95J8iIYcd+pS2P yrGFJo3Tif5G3uVaWboGCkqmDNDMOTj3ALfkx5VYpWeWMmlpFUeCB6NZqk3pN51Mdc1GtZi8B2KVZ 6KPOjYftfokrfQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:29 +0100 Message-ID: <2dc7577f5d1ea86b390b7dc48b82cf887f29020e.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/home.scm (%base-home-services): New variable. ()[services]: Change default to ‘%base-home-services’. * guix/scripts/home/import.scm (manifest+configuration-files->code): Use ‘%base-home-services’ by default. * tests/home-import.scm (match-home-environment-no-services) (match-home-environment-transformations) (match-home-environment-no-services-nor-packages) (match-home-environment-bash-service) (match-home-environment-bash-service-with-alias): Adjust accordingly. * doc/he-config-bare-bones.scm: Use ‘%base-home-services’. * doc/guix.texi (Declaring the Home Environment): Add index entry for ‘%base-home-services’. Change-Id: Id95ede62b97a976aad138bfc4b63fc0bdf37c7de Reviewed-by: Maxim Cournoyer --- doc/guix.texi | 1 + doc/he-config-bare-bones.scm | 27 ++++++++++++------------ gnu/home.scm | 11 ++++++++-- guix/scripts/home/import.scm | 8 +++++--- tests/home-import.scm | 40 +++++++++++++++++++----------------- 5 files changed, 50 insertions(+), 37 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 788a9b4957..adcae42523 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -45563,6 +45563,7 @@ Declaring the Home Environment @end quotation @findex home-environment +@vindex %base-home-services @lisp @include he-config-bare-bones.scm @end lisp diff --git a/doc/he-config-bare-bones.scm b/doc/he-config-bare-bones.scm index f948d85277..844d666110 100644 --- a/doc/he-config-bare-bones.scm +++ b/doc/he-config-bare-bones.scm @@ -7,19 +7,20 @@ (home-environment - (packages (list htop)) - (services - (list - (service home-bash-service-type - (home-bash-configuration - (guix-defaults? #t) - (bash-profile (list (plain-file "bash-profile" "\ + (packages (list htop)) + (services + (append (list + (service home-bash-service-type + (home-bash-configuration + (guix-defaults? #t) + (bash-profile (list (plain-file "bash-profile" "\ export HISTFILE=$XDG_CACHE_HOME/.bash_history"))))) - (simple-service 'test-config - home-xdg-configuration-files-service-type - (list `("test.conf" - ,(plain-file "tmp-file.txt" - "the content of - ~/.config/test.conf"))))))) + (simple-service 'test-config + home-xdg-configuration-files-service-type + (list `("test.conf" + ,(plain-file "tmp-file.txt" + "the content of + ~/.config/test.conf"))))) + %base-home-services))) diff --git a/gnu/home.scm b/gnu/home.scm index b390c8d534..042d2e67de 100644 --- a/gnu/home.scm +++ b/gnu/home.scm @@ -23,6 +23,7 @@ (define-module (gnu home) #:use-module (gnu home services shells) #:use-module (gnu home services xdg) #:use-module (gnu home services fontutils) + #:use-module (gnu home services admin) #:use-module (gnu services) #:use-module (guix records) #:use-module (guix diagnostics) @@ -43,7 +44,9 @@ (define-module (gnu home) home-environment-with-provenance - home-generation-base)) + home-generation-base + + %base-home-services)) ;;; Comment: ;;; @@ -67,7 +70,7 @@ (define-record-type* home-environment this-home-environment))) (services home-environment-user-services - (default '()) + (default %base-home-services) (sanitize validate-service-list)) (location home-environment-location ; @@ -75,6 +78,10 @@ (define-record-type* home-environment source-properties->location)) (innate))) +(define %base-home-services + ;; Non-essential but useful services to have by default. + '()) + (define (home-environment-default-essential-services he) "Return the list of essential services for home environment." (list diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index fd263c0699..15b4bc9798 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Andrew Tropin -;;; Copyright © 2021-2022 Ludovic Courtès +;;; Copyright © 2021-2022, 2024 Ludovic Courtès ;;; Copyright © 2022 Arjan Adriaanse ;;; Copyright © 2022 Antero Mejr ;;; @@ -160,7 +160,8 @@ (define (manifest+configuration-files->code manifest (home-environment (packages ,packages) - (services (list ,@services))))))) + (services (append (list ,@services) + %base-home-services))))))) (('begin ('specifications->manifest packages)) (match (configurations+modules configuration-directory) (((services . modules) ...) @@ -183,7 +184,8 @@ (define (manifest+configuration-files->code manifest ,(comment (G_ "\ ;; Below is the list of Home services. To search for available ;; services, run 'guix home search KEYWORD' in a terminal.\n")) - (services (list ,@services))))))))) + (services (append (list ,@services) + %base-home-services))))))))) (define* (import-manifest manifest destination-directory diff --git a/tests/home-import.scm b/tests/home-import.scm index 04b7b76156..57a3d62a72 100644 --- a/tests/home-import.scm +++ b/tests/home-import.scm @@ -115,7 +115,7 @@ (define-home-environment-matcher match-home-environment-no-services ('specifications->packages ('list "guile@2.0.9" "gcc:lib" "glibc@2.19"))) ('services - ('list))))) + ('append ('list) '%base-home-services))))) (define-home-environment-matcher match-home-environment-transformations ('begin @@ -131,7 +131,7 @@ (define-home-environment-matcher match-home-environment-transformations ('list (transform ('specification->package "guile@2.0.9")) ('list ('specification->package "gcc") "lib") ('specification->package "glibc@2.19"))) - ('services ('list))))) + ('services ('append ('list) '%base-home-services))))) (define-home-environment-matcher match-home-environment-no-services-nor-packages ('begin @@ -143,7 +143,7 @@ (define-home-environment-matcher match-home-environment-no-services-nor-packages ('packages ('specifications->packages ('list))) ('services - ('list))))) + ('append ('list) '%base-home-services))))) (define-home-environment-matcher match-home-environment-bash-service ('begin @@ -157,13 +157,14 @@ (define-home-environment-matcher match-home-environment-bash-service ('packages ('specifications->packages ('list))) ('services - ('list ('service - 'home-bash-service-type - ('home-bash-configuration - ('aliases ('quote ())) - ('bashrc - ('list ('local-file "/tmp/guix-config/.bashrc" - "bashrc")))))))))) + (append ('list ('service + 'home-bash-service-type + ('home-bash-configuration + ('aliases ('quote ())) + ('bashrc + ('list ('local-file "/tmp/guix-config/.bashrc" + "bashrc")))))) + '%base-home-services))))) (define-home-environment-matcher match-home-environment-bash-service-with-alias ('begin @@ -177,15 +178,16 @@ (define-home-environment-matcher match-home-environment-bash-service-with-alias ('packages ('specifications->packages ('list))) ('services - ('list ('service - 'home-bash-service-type - ('home-bash-configuration - ('aliases - ('quote (("grep" . "grep --exclude-from=\"$HOME/.grep-exclude\"") - ("ls" . "ls -p")))) - ('bashrc - ('list ('local-file "/tmp/guix-config/.bashrc" - "bashrc")))))))))) + ('append ('list ('service + 'home-bash-service-type + ('home-bash-configuration + ('aliases + ('quote (("grep" . "grep --exclude-from=\"$HOME/.grep-exclude\"") + ("ls" . "ls -p")))) + ('bashrc + ('list ('local-file "/tmp/guix-config/.bashrc" + "bashrc")))))) + '%base-home-services))))) (test-assert "manifest->code: No services" From patchwork Fri Dec 13 22:58:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34888 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 44CDF27BBEB; Fri, 13 Dec 2024 23:03:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 227A327BBE2 for ; Fri, 13 Dec 2024 23:03:15 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMEfr-00041Q-27; Fri, 13 Dec 2024 18:02:19 -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 1tMEff-0003xi-58 for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMEfe-0002m2-HL for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=bUoICoOpEKI9Ty00oDEYOtqpsQCaJX2gDKMzvzk0kHk=; b=ZHBy5G9TGPe7e5aiGlxnA3uC1yfuQE2xllPWy5hN/jRJNaie0ppac5rcx3KL79P34p8493sqv9wDkaRt82zTn+4w5vhbGy6gXnIIxc7r7NGGC8j0Vs+SEBhqG1ZAwCqqVIezIi2lqWVIpCRoLD0fqwNFm0PEVBtws4zOoWQxti3kXJdU7bM9mo3yNHSJGRin+XuhseBIX6tVUV19k1VVu9bTbkhLgYY1iwBkDBxrMMeLIXJ+gSyT5GhaIoS3W5kgLR9g6FNqeCmp6YZSD+K2FCKzeBFGjvPklyZPjsvuQVb7ZPI1GcsNTz+x6+0tAK+DuU4qIHnzSaOpCfPGyfG5Tw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMEfe-0001ZB-B4 for guix-patches@gnu.org; Fri, 13 Dec 2024 18:02:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH 10/10] home: Add log rotation to =?utf-8?b?4oCY?= =?utf-8?b?JWJhc2UtaG9tZS1zZXJ2aWNlc+KAmS4=?= Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Fri, 13 Dec 2024 23:02:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74860@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , ( , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer , Tanguy Le Carrour X-Debbugs-Original-Xcc: ( , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer , Tanguy Le Carrour Received: via spool by 74860-submit@debbugs.gnu.org id=B74860.17341309165931 (code B ref 74860); Fri, 13 Dec 2024 23:02:06 +0000 Received: (at 74860) by debbugs.gnu.org; 13 Dec 2024 23:01:56 +0000 Received: from localhost ([127.0.0.1]:44587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEfT-0001XU-QL for submit@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMEfP-0001X0-C4 for 74860@debbugs.gnu.org; Fri, 13 Dec 2024 18:01:51 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMEdD-0001qE-QR; Fri, 13 Dec 2024 17:59:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=bUoICoOpEKI9Ty00oDEYOtqpsQCaJX2gDKMzvzk0kHk=; b=ACZVJ4BpNwgS0dLeE5OT Q1SZhopJwjQ3I7cUkeA9383RWTXJiwirknkQwLp2k8jueeMoQ+ruKTiF4jyS3q3WKRGbmH+xsAnuo IwDtgbolyv5Spb5LovuYVaugUeYpJ8e+qnhhJs28EEL1LjdmeYY43Ra5JGR87diWhVdldZkG99f8F gVLZztKOKcU4ps1l2orkrBPdGONNW7Nq82W7iU5c5VsNvtt9/iuyw92QWLTjaU7F+6az8/nuFzaBD Lm/9962+7wIObqop1GQlg8H11AFbLLk1hrSxdQcKPLTsF+uTV44Cf6tp1uOiztFuVbIHM1zwHI7kZ Bb8BeaML8Vs5JQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Dec 2024 23:58:30 +0100 Message-ID: <8834c6924b7226d6e9cff867edc7121b44ccdd9f.1734129908.git.ludo@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/home.scm (%base-home-services): Add instance of ‘home-log-rotation-service-type’. * doc/guix.texi (Shepherd Home Service): Document it. Change-Id: I00a98da100e3a07fe409f3c44d8ab88e743a8e3e Reviewed-by: Maxim Cournoyer --- doc/guix.texi | 2 ++ gnu/home.scm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index adcae42523..ddb38a8040 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -46601,6 +46601,8 @@ Shepherd Home Service Its value must be a @code{log-rotation-configuration} record, exactly as for its system-wide counterpart. @xref{log-rotation-configuration}, for its reference. + +This service is part of @code{%base-home-services}. @end defvar @node Secure Shell diff --git a/gnu/home.scm b/gnu/home.scm index 042d2e67de..3b479f64f9 100644 --- a/gnu/home.scm +++ b/gnu/home.scm @@ -80,7 +80,7 @@ (define-record-type* home-environment (define %base-home-services ;; Non-essential but useful services to have by default. - '()) + (list (service home-log-rotation-service-type))) (define (home-environment-default-essential-services he) "Return the list of essential services for home environment."