From patchwork Wed Jan 8 21:51:57 2025 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: 36794 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 52FF627BBE9; Wed, 8 Jan 2025 21:54:42 +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 2373E27BBEA for ; Wed, 8 Jan 2025 21:54:41 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVe0W-00019S-IA; Wed, 08 Jan 2025 16:54:32 -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 1tVe09-0000HY-6V for guix-patches@gnu.org; Wed, 08 Jan 2025 16:54:11 -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 1tVe08-0004Ic-QT; Wed, 08 Jan 2025 16:54:08 -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=rtx6jF9s547Sdf8qK+wTeWLZznPqsY3ur02Ejgc+6M4=; b=bNVVHMgC0OKmMoLSP0O0zdtcWMacWEhxMbAywaMrfnw+x6TzcFQnu3dhfC+dGuKe+ZDjYJ2TRKjWEPV3EjWuFuM7IT/J3eH90yqWYqtQKIAw5hz/sxi6DwVeHIWuwXegfFttAB7p8gV8fj5/b5CKSgphEOcPOXvAkayZ1EByFJsQSlctld2Rx6DDq4K1FbyQQq7EN3Ea4Anlq8Oskm2f2p633XPigcaesQDD1p8Ak5WYeoalMX2yyrfIIfNeXJnA2hZTqQiqlcLT9VoUCTSmuLYmzoMDY578auhlsSsyPuHMixjjMoyeFS9bDh/x5KHCSjnAhg1XXTe1Ky0ahRAtOw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVe04-0005Y8-QP; Wed, 08 Jan 2025 16:54:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74860] [PATCH v3 09/12] home: services: Add log rotation service. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, maxim.cournoyer@gmail.com, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Wed, 08 Jan 2025 21:54: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?= , 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.173637319721203 (code B ref 74860); Wed, 08 Jan 2025 21:54:04 +0000 Received: (at 74860) by debbugs.gnu.org; 8 Jan 2025 21:53:17 +0000 Received: from localhost ([127.0.0.1]:49318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVdzJ-0005Vp-8r for submit@debbugs.gnu.org; Wed, 08 Jan 2025 16:53:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55116) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVdz8-0005Ta-Tp for 74860@debbugs.gnu.org; Wed, 08 Jan 2025 16:53:07 -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 1tVdz3-00047K-IK; Wed, 08 Jan 2025 16:53:01 -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=rtx6jF9s547Sdf8qK+wTeWLZznPqsY3ur02Ejgc+6M4=; b=Ok4ktuoXOWCfji+MLhRr /X0LOZgCDUZdtMIjN7CWopA6H68CiU7LEFwu9UNXvVJLhMhDMxl1TAGLVmNPx6ZO1jXrOSNs5Cawu o0/B52HT15Mfs4mA90On1OPyEQZFkWeNGSwVEimIfvlp495FOpT+KyepudnVQzvcpx0FiDYGGc5xK +F8TdI2AIeXADdZnzN6W8EXDL9pizmO75a1HcSrGC2O5dMBJA5ck0vxbNiPkW2HkSPeloljFTWcAo StH9Tms87+P+R8SH+pZeuynRYwoG3rWyW4zZY9tcXjsgz7QGkHlLKYaJZ9LKz4lUkJRZQJzhZUIQS AhBifc4bHHVpZA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 8 Jan 2025 22:51:57 +0100 Message-ID: <24304f1ae073bbd8cf2be1f7b79b61413f3a68da.1736373023.git.ludo@gnu.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 7bc1d0b9e5..1b8047585d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20909,6 +20909,7 @@ Log Rotation be a @code{log-rotation-configuration} record, as discussed below. @end defvar +@anchor{log-rotation-configuration} @c %start of fragment @deftp {Data Type} log-rotation-configuration @@ -47090,6 +47091,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 f118fe4442..e4840fd550 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 \