From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 8EhjHccZSWZTbAAAqHPOHw:P1 (envelope-from ) for ; Sat, 18 May 2024 23:12:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 8EhjHccZSWZTbAAAqHPOHw (envelope-from ) for ; Sat, 18 May 2024 23:12:39 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=hEqArUVF; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716066759; a=rsa-sha256; cv=none; b=VxccWsK2WUoj3zXCDBrPTRL+/imZX7gtxgM+jik5y7ZOqca0/M2JSu+tJWnvbo9yX0zeVy d4Zh+qZBoPM46gesp7Orq7Lhk4per94/WLzNYhIvMw5MpJk6/HVKgXqYvoeCCYzc9eteTw SOhRA5PZNBlIH7SwZe799Qr9GNUqD/nlF0h+S69FV87g5aObZ58ZuxR2ej/wHRH0ZLyKw+ 7Ovgn8EKPlDVlHuKcMwJEABAbG/UpBVq7Vemb1FZJ+NZJmjRhYLHzAmVkZA280XECMBK7y x/eIvKUrAysBu/lYZOj3a73fv5dY2xaTwDK3482sOVXvYLfYjif1N7P4HLbAfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=hEqArUVF; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716066759; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=JeAVlyIUEZF4T1p2XEAl2WY6ZMCoS6F++InXIVTgIHI=; b=EwjkTLnmu4PSo0Qo3bQycr9Kb6XAJjiYHKCdG02DAaj4XbX6ujpDOcbz3Fo46a5N/V81gf ZtUb396rxmk4SsEM4VzxqdSfEUYOeLwe2/Kwsfdt+gi6tg63UnVpwZknDckneLYIH9hYou 7OR7oBHJuW8zadKh1bRPLoamviqQtsuK+2CjTAWXj4VKPiWIOeWAiJotAhG1neitxqGiwQ EIwz4maMWP+Dq74UUE4dLNx0WmUxYm9mMmTLS+wab8HG1oNJNxI+Jv7i+xJ5FGOTB1+06w VfV43RWIFkFARfEju4vjusDTugfVfOs4TBq8F0OtvEz+rIKRbQQYZSZBsqddmQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2AE4C63573 for ; Sat, 18 May 2024 23:12:39 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8RLF-00045g-Lo; Sat, 18 May 2024 17:11:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8RLE-00044I-Ax for guix-devel@gnu.org; Sat, 18 May 2024 17:11:44 -0400 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 1s8RLE-0000mw-2l for guix-devel@gnu.org; Sat, 18 May 2024 17:11:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=JeAVlyIUEZF4T1p2XEAl2WY6ZMCoS6F++InXIVTgIHI=; b=hEqArUVFAPpbok DrmA1oTZNi0d6Q+LNXiIbtkGfWIKuE+d6UzSbusS5bo4y/vytZQdwwCovC3t1vWbR1d2q3WsEmJHR L4oOXtQ9QiXNpHSKY813r1WvBdlVXyIUGHlBn0IvhiCNPDGhaxezR+i6lSPfypia34Mm26cISk1Y/ CdwCltnlY9/qRkipXpEBnk5daHxMxWkSyAiXw6uI38ES4ffw88hZuNvyyeq2Dw5epw91Zw7bK8J9d uJCLoi7KwXIE9yaqlF8f3in6v0ZUDl9/JYGpAnAsOuZNDE9iDsR8HU86gVpji+LjREA1+8H8WpgWd hBxNXyTEZZPpId6NEF0A==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: guix-devel@gnu.org Subject: Shepherd log rotation service X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 30 =?utf-8?Q?Flor=C3=A9al?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la Houlette X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 18 May 2024 23:11:40 +0200 Message-ID: <87ed9y4ygj.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 2AE4C63573 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -11.12 X-Spam-Score: -11.12 X-TUID: fzZid2nG4ClA Hello Guix! I=E2=80=99ve just pushed a simple log rotation service for Shepherd: https://git.savannah.gnu.org/cgit/shepherd.git/commit/?h=3Ddevel&id=3D048= 4726801c2b5c1b7deecb9a96054c2c510ac71 It rotates log files roughly the same way we=E2=80=99ve been doing since the 70=E2=80=99s, but there=E2=80=99s a couple of advantages compared to what w= e=E2=80=99re currently doing in Guix System: =E2=80=A2 No need to repeat the name of log files since shepherd already = knows them via #:log-file (that=E2=80=99s another reason to avoid non-shepherd-managed log files). =E2=80=A2 Rotation is race-free: it=E2=80=99s impossible to lose a line o= f log while the file is being rotated. This is guaranteed by the =E2=80=9Clogger= =E2=80=9D, which offers a method to atomically close its log file, rename it, and open a new empty log file. =E2=80=A2 The log rotation service is a timer so one can inspect it with = =E2=80=98herd status log-rotation=E2=80=99, trigger it with =E2=80=98herd trigger log= -rotation=E2=80=99, and so on. At this point the log file of shepherd itself, for instance /var/log/messages, is not handled; this will have to be fixed. There aren=E2=80=99t many options to specify how to rotate logs (very few compared to rottlog!), but I figured we=E2=80=99d rather have something sim= ple that works well and without surprises; we can always add knobs later if necessary. Feedback welcome! Ludo=E2=80=99.