From unknown Sat Aug 16 23:48:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#55600] [PATCH] gnu: services: networking: Add log rotation to most services. Resent-From: ykonai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 23 May 2022 20:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55600 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55600@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16533359896528 (code B ref -1); Mon, 23 May 2022 20:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 May 2022 19:59:49 +0000 Received: from localhost ([127.0.0.1]:50267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntEDS-0001h8-8j for submit@debbugs.gnu.org; Mon, 23 May 2022 15:59:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:51826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntDtc-00019l-Vg for submit@debbugs.gnu.org; Mon, 23 May 2022 15:39:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntDtc-0002Gx-NU for guix-patches@gnu.org; Mon, 23 May 2022 15:39:16 -0400 Received: from www.ykonai.net ([2605:6400:10:1424:8f2:1eb3:b35b:fe2d]:49254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntDta-0002O4-6w for guix-patches@gnu.org; Mon, 23 May 2022 15:39:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ykonai.net; s=20220513; t=1653334830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=bEbR3kcD9pumx1gR1TX5YVBLa9kYVmX6jRewkoH6zZE=; b=XrxP1luUKnluNWv3L2cDPzRC8kLKVYnrdAGWXrvHAshU4EBLCzyPZfDsKp8Eqyp7ksgyCj 9IIgHCVDSOHZk8GNGDLXuFKKs44vGvmBR/EO5gXJvudfX6biBX5N9BfBezguEO3h3d6//J 4ttg3baWRHCOCGeUSKZlAQ3hckqeWvnGWpGULo7dugVhUUmVHEzss9b7aanFJCYqX26s1Y PddsJ9AlZ0ry5yZDPtiGn3Dff43dmsU6QE4fbqMj74nlCpj1pr+Ry6QZZEAcjFbbRJG6jg ZhV9TlzJ5GRjLO5i+PYhShZsS2vsWtg3QZbSb2N0GUM+42slreUpWYXj0Yyi+A== Received: by www.ykonai.net (OpenSMTPD) with ESMTPSA id 59b948c1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 23 May 2022 19:40:30 +0000 (UTC) From: ykonai Date: Mon, 23 May 2022 21:39:08 +0200 Message-Id: <20220523193908.9016-1-mail@ykonai.net> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2605:6400:10:1424:8f2:1eb3:b35b:fe2d; envelope-from=mail@ykonai.net; helo=www.ykonai.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Mailman-Approved-At: Mon, 23 May 2022 15:59:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) This adds a simple log rotation extension to every networking service that specifies a #:log-file in its Shepherd service, which should prevent some logs from accumulating indefinitely. * gnu/services/networking.scm: Add log rotation to most services. --- gnu/services/networking.scm | 72 +++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 399cd03c1d..d8fe638940 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -41,6 +41,7 @@ (define-module (gnu services networking) #:use-module (gnu services linux) #:use-module (gnu services shepherd) #:use-module (gnu services dbus) + #:use-module (gnu services admin) #:use-module (gnu system shadow) #:use-module (gnu system pam) #:use-module ((gnu system file-systems) #:select (file-system-mapping)) @@ -384,6 +385,11 @@ (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 @@ -532,7 +538,9 @@ (define ntp-service-type (service-extension account-service-type (const %ntp-accounts)) (service-extension activation-service-type - ntp-service-activation))) + ntp-service-activation) + (service-extension rottlog-service-type + (const %ntp-log-rotation)))) (description "Run the @command{ntpd}, the Network Time Protocol (NTP) daemon of the @uref{http://www.ntp.org, Network Time Foundation}. The daemon @@ -614,7 +622,7 @@ (define ntpd.conf ;; When ntpd is daemonized it repeatedly tries to respawn ;; while running, leading shepherd to disable it. To ;; prevent spamming stderr, redirect output to logfile. - #:log-file "/var/log/ntpd")) + #:log-file "/var/log/ntpd.log")) (stop #~(make-kill-destructor)))))) (define (openntpd-service-activation config) @@ -640,7 +648,9 @@ (define openntpd-service-type (service-extension profile-service-type (compose list openntpd-configuration-openntpd)) (service-extension activation-service-type - openntpd-service-activation))) + openntpd-service-activation) + (service-extension rottlog-service-type + (const %ntp-log-rotation)))) (default-value (openntpd-configuration)) (description "Run the @command{ntpd}, the Network Time Protocol (NTP) @@ -987,6 +997,10 @@ (define (tor-shepherd-service config) (stop #~(make-kill-destructor)) (documentation "Run the Tor anonymous network overlay.")))))))) +(define %tor-log-rotation + (list (log-rotation + (files '("/var/log/tor.log"))))) + (define (tor-activation config) "Set up directories for Tor and its hidden services, if any." #~(begin @@ -1032,7 +1046,9 @@ (define tor-service-type (service-extension account-service-type (const %tor-accounts)) (service-extension activation-service-type - tor-activation))) + tor-activation) + (service-extension rottlog-service-type + (const %tor-log-rotation)))) ;; This can be extended with hidden services. (compose concatenate) @@ -1314,6 +1330,10 @@ (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) @@ -1328,7 +1348,9 @@ (define connman-service-type connman-activation) ;; Add connman to the system profile. (service-extension profile-service-type - connman-package))) + connman-package) + (service-extension rottlog-service-type + (const %connman-log-rotation)))) (default-value (connman-configuration)) (description "Run @url{https://01.org/connman,Connman}, @@ -1570,12 +1592,18 @@ (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))) + hostapd-shepherd-services) + (service-extension rottlog-service-type + (const %hostapd-log-rotation)))) (description "Run the @uref{https://w1.fi/hostapd/, hostapd} daemon for Wi-Fi access points and authentication servers."))) @@ -1867,6 +1895,10 @@ (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 @@ -1885,7 +1917,9 @@ (define pagekite-service-type (list (service-extension shepherd-root-service-type (compose list pagekite-shepherd-service)) (service-extension account-service-type - (const %pagekite-accounts)))) + (const %pagekite-accounts)) + (service-extension rottlog-service-type + (const %pagekite-log-rotation)))) (description "Run @url{https://pagekite.net/,PageKite}, a tunneling solution to make local servers publicly accessible on the web, even behind NATs and firewalls."))) @@ -1976,6 +2010,10 @@ (define yggdrasil-command #: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)))) @@ -1991,7 +2029,9 @@ (define yggdrasil-service-type (service-extension account-service-type (const %yggdrasil-accounts)) (service-extension profile-service-type - (compose list yggdrasil-configuration-package)))))) + (compose list yggdrasil-configuration-package)) + (service-extension rottlog-service-type + (const %yggdrasil-log-rotation)))))) ;;; @@ -2061,6 +2101,10 @@ (define ipfs-daemon-command #: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) @@ -2116,7 +2160,9 @@ (define ipfs-service-type (service-extension activation-service-type %ipfs-activation) (service-extension shepherd-root-service-type - ipfs-shepherd-service))) + ipfs-shepherd-service) + (service-extension rottlog-service-type + (const %ipfs-log-rotation)))) (default-value (ipfs-configuration)) (description "Run @command{ipfs daemon}, the reference implementation @@ -2153,10 +2199,16 @@ (define keepalived-shepherd-service (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))) + keepalived-shepherd-service) + (service-extension rottlog-service-type + (const %keepalived-log-rotation)))) (description "Run @uref{https://www.keepalived.org/, Keepalived} routing software."))) base-commit: 2f58393d995de9638140962cf4c40e5f2ba08c3a prerequisite-patch-id: cae10b00f0ef0adfefaae7541ddccbd244bb73c5 -- 2.36.1 From unknown Sat Aug 16 23:48:38 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: ykonai Subject: bug#55600: closed (Re: bug#55600: [PATCH] gnu: services: networking: Add log rotation to most services.) Message-ID: References: <87bkvnknhq.fsf@gnu.org> <20220523193908.9016-1-mail@ykonai.net> X-Gnu-PR-Message: they-closed 55600 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 55600@debbugs.gnu.org Date: Tue, 24 May 2022 14:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1653402962-31619-1" This is a multi-part message in MIME format... ------------=_1653402962-31619-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #55600: [PATCH] gnu: services: networking: Add log rotation to most service= s. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 55600@debbugs.gnu.org. --=20 55600: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D55600 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1653402962-31619-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 55600-done) by debbugs.gnu.org; 24 May 2022 14:35:12 +0000 Received: from localhost ([127.0.0.1]:53018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntVcu-0008Cu-ET for submit@debbugs.gnu.org; Tue, 24 May 2022 10:35:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntVcs-0008Cf-7T for 55600-done@debbugs.gnu.org; Tue, 24 May 2022 10:35:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntVcm-0001yR-8c; Tue, 24 May 2022 10:35:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=AJB4DNw70Z6kP2lKxHBMY6AsN9Bw7ptsmYkasYuOpIQ=; b=UA5AB21rjXuOykeDZNpc /Mfx9vvSFE7AvxokFuIh1/nf1BbGQNwUm/LLCMODFPcTDnNHB+wBQlyDOJM5+WL4g9yYYwL5xPJgC yE3yW0rBisrfuaVy18usS/b3ykAX2UvRPeQ20QFULZ1RDI2Xy84rwbiL6i+EkZUEnRFtuDR+19qty QX1gTPDcX/rXRVQTrQC4nMoOmZav7d3e1IFv+PfO8slz5W5jLl+1fq37KY2lrjo2RRy6IETCnzwV4 wETIbinCeDVR/F4OX3hoYrq5rWRmHAXmFhVQCg9I9HiXL+/J02yl9XHUjD8yzrcPHYzfFwKmhZtr4 ToGIQPd5lo2aSw==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=36550 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntVcg-0005Fo-Vf; Tue, 24 May 2022 10:35:03 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: ykonai Subject: Re: bug#55600: [PATCH] gnu: services: networking: Add log rotation to most services. References: <20220523193908.9016-1-mail@ykonai.net> Date: Tue, 24 May 2022 16:34:57 +0200 In-Reply-To: <20220523193908.9016-1-mail@ykonai.net> (ykonai's message of "Mon, 23 May 2022 21:39:08 +0200") Message-ID: <87bkvnknhq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55600-done Cc: 55600-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, ykonai skribis: > This adds a simple log rotation extension to every networking service that > specifies a #:log-file in its Shepherd service, which should prevent some= logs > from accumulating indefinitely. > > * gnu/services/networking.scm: Add log rotation to most services. I tweaked the commit log as per our conventions=C2=B9 and applied it. Thanks, Ludo=E2=80=99. =C2=B9 https://guix.gnu.org/manual/devel/en/html_node/Submitting-Patches.ht= ml ------------=_1653402962-31619-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 May 2022 19:59:49 +0000 Received: from localhost ([127.0.0.1]:50267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntEDS-0001h8-8j for submit@debbugs.gnu.org; Mon, 23 May 2022 15:59:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:51826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntDtc-00019l-Vg for submit@debbugs.gnu.org; Mon, 23 May 2022 15:39:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntDtc-0002Gx-NU for guix-patches@gnu.org; Mon, 23 May 2022 15:39:16 -0400 Received: from www.ykonai.net ([2605:6400:10:1424:8f2:1eb3:b35b:fe2d]:49254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntDta-0002O4-6w for guix-patches@gnu.org; Mon, 23 May 2022 15:39:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ykonai.net; s=20220513; t=1653334830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=bEbR3kcD9pumx1gR1TX5YVBLa9kYVmX6jRewkoH6zZE=; b=XrxP1luUKnluNWv3L2cDPzRC8kLKVYnrdAGWXrvHAshU4EBLCzyPZfDsKp8Eqyp7ksgyCj 9IIgHCVDSOHZk8GNGDLXuFKKs44vGvmBR/EO5gXJvudfX6biBX5N9BfBezguEO3h3d6//J 4ttg3baWRHCOCGeUSKZlAQ3hckqeWvnGWpGULo7dugVhUUmVHEzss9b7aanFJCYqX26s1Y PddsJ9AlZ0ry5yZDPtiGn3Dff43dmsU6QE4fbqMj74nlCpj1pr+Ry6QZZEAcjFbbRJG6jg ZhV9TlzJ5GRjLO5i+PYhShZsS2vsWtg3QZbSb2N0GUM+42slreUpWYXj0Yyi+A== Received: by www.ykonai.net (OpenSMTPD) with ESMTPSA id 59b948c1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 23 May 2022 19:40:30 +0000 (UTC) From: ykonai To: guix-patches@gnu.org Subject: [PATCH] gnu: services: networking: Add log rotation to most services. Date: Mon, 23 May 2022 21:39:08 +0200 Message-Id: <20220523193908.9016-1-mail@ykonai.net> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2605:6400:10:1424:8f2:1eb3:b35b:fe2d; envelope-from=mail@ykonai.net; helo=www.ykonai.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 23 May 2022 15:59:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) This adds a simple log rotation extension to every networking service that specifies a #:log-file in its Shepherd service, which should prevent some logs from accumulating indefinitely. * gnu/services/networking.scm: Add log rotation to most services. --- gnu/services/networking.scm | 72 +++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 399cd03c1d..d8fe638940 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -41,6 +41,7 @@ (define-module (gnu services networking) #:use-module (gnu services linux) #:use-module (gnu services shepherd) #:use-module (gnu services dbus) + #:use-module (gnu services admin) #:use-module (gnu system shadow) #:use-module (gnu system pam) #:use-module ((gnu system file-systems) #:select (file-system-mapping)) @@ -384,6 +385,11 @@ (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 @@ -532,7 +538,9 @@ (define ntp-service-type (service-extension account-service-type (const %ntp-accounts)) (service-extension activation-service-type - ntp-service-activation))) + ntp-service-activation) + (service-extension rottlog-service-type + (const %ntp-log-rotation)))) (description "Run the @command{ntpd}, the Network Time Protocol (NTP) daemon of the @uref{http://www.ntp.org, Network Time Foundation}. The daemon @@ -614,7 +622,7 @@ (define ntpd.conf ;; When ntpd is daemonized it repeatedly tries to respawn ;; while running, leading shepherd to disable it. To ;; prevent spamming stderr, redirect output to logfile. - #:log-file "/var/log/ntpd")) + #:log-file "/var/log/ntpd.log")) (stop #~(make-kill-destructor)))))) (define (openntpd-service-activation config) @@ -640,7 +648,9 @@ (define openntpd-service-type (service-extension profile-service-type (compose list openntpd-configuration-openntpd)) (service-extension activation-service-type - openntpd-service-activation))) + openntpd-service-activation) + (service-extension rottlog-service-type + (const %ntp-log-rotation)))) (default-value (openntpd-configuration)) (description "Run the @command{ntpd}, the Network Time Protocol (NTP) @@ -987,6 +997,10 @@ (define (tor-shepherd-service config) (stop #~(make-kill-destructor)) (documentation "Run the Tor anonymous network overlay.")))))))) +(define %tor-log-rotation + (list (log-rotation + (files '("/var/log/tor.log"))))) + (define (tor-activation config) "Set up directories for Tor and its hidden services, if any." #~(begin @@ -1032,7 +1046,9 @@ (define tor-service-type (service-extension account-service-type (const %tor-accounts)) (service-extension activation-service-type - tor-activation))) + tor-activation) + (service-extension rottlog-service-type + (const %tor-log-rotation)))) ;; This can be extended with hidden services. (compose concatenate) @@ -1314,6 +1330,10 @@ (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) @@ -1328,7 +1348,9 @@ (define connman-service-type connman-activation) ;; Add connman to the system profile. (service-extension profile-service-type - connman-package))) + connman-package) + (service-extension rottlog-service-type + (const %connman-log-rotation)))) (default-value (connman-configuration)) (description "Run @url{https://01.org/connman,Connman}, @@ -1570,12 +1592,18 @@ (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))) + hostapd-shepherd-services) + (service-extension rottlog-service-type + (const %hostapd-log-rotation)))) (description "Run the @uref{https://w1.fi/hostapd/, hostapd} daemon for Wi-Fi access points and authentication servers."))) @@ -1867,6 +1895,10 @@ (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 @@ -1885,7 +1917,9 @@ (define pagekite-service-type (list (service-extension shepherd-root-service-type (compose list pagekite-shepherd-service)) (service-extension account-service-type - (const %pagekite-accounts)))) + (const %pagekite-accounts)) + (service-extension rottlog-service-type + (const %pagekite-log-rotation)))) (description "Run @url{https://pagekite.net/,PageKite}, a tunneling solution to make local servers publicly accessible on the web, even behind NATs and firewalls."))) @@ -1976,6 +2010,10 @@ (define yggdrasil-command #: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)))) @@ -1991,7 +2029,9 @@ (define yggdrasil-service-type (service-extension account-service-type (const %yggdrasil-accounts)) (service-extension profile-service-type - (compose list yggdrasil-configuration-package)))))) + (compose list yggdrasil-configuration-package)) + (service-extension rottlog-service-type + (const %yggdrasil-log-rotation)))))) ;;; @@ -2061,6 +2101,10 @@ (define ipfs-daemon-command #: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) @@ -2116,7 +2160,9 @@ (define ipfs-service-type (service-extension activation-service-type %ipfs-activation) (service-extension shepherd-root-service-type - ipfs-shepherd-service))) + ipfs-shepherd-service) + (service-extension rottlog-service-type + (const %ipfs-log-rotation)))) (default-value (ipfs-configuration)) (description "Run @command{ipfs daemon}, the reference implementation @@ -2153,10 +2199,16 @@ (define keepalived-shepherd-service (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))) + keepalived-shepherd-service) + (service-extension rottlog-service-type + (const %keepalived-log-rotation)))) (description "Run @uref{https://www.keepalived.org/, Keepalived} routing software."))) base-commit: 2f58393d995de9638140962cf4c40e5f2ba08c3a prerequisite-patch-id: cae10b00f0ef0adfefaae7541ddccbd244bb73c5 -- 2.36.1 ------------=_1653402962-31619-1--