From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OCDbMArYS2R4cAAASxT56A (envelope-from ) for ; Fri, 28 Apr 2023 16:28:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sJ2uMArYS2TPEwEA9RJhRA (envelope-from ) for ; Fri, 28 Apr 2023 16:28:26 +0200 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 A9A3B2D18A for ; Fri, 28 Apr 2023 16:28:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psP59-0007ip-UW; Fri, 28 Apr 2023 10:28:20 -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 1psP4u-0007Wx-0V for bug-guix@gnu.org; Fri, 28 Apr 2023 10:28:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1psP4t-0005yN-Mz for bug-guix@gnu.org; Fri, 28 Apr 2023 10:28:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1psP4t-00058O-IZ for bug-guix@gnu.org; Fri, 28 Apr 2023 10:28:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63082: [PATCH 08/17] services: mpd: Only rotate log when a log file is specified. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 28 Apr 2023 14:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63082 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 63082@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 63082-submit@debbugs.gnu.org id=B63082.168269206019590 (code B ref 63082); Fri, 28 Apr 2023 14:28:03 +0000 Received: (at 63082) by debbugs.gnu.org; 28 Apr 2023 14:27:40 +0000 Received: from localhost ([127.0.0.1]:34135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psP4W-00055t-Gj for submit@debbugs.gnu.org; Fri, 28 Apr 2023 10:27:40 -0400 Received: from mail-qk1-f175.google.com ([209.85.222.175]:62483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psP4M-00053n-8T for 63082@debbugs.gnu.org; Fri, 28 Apr 2023 10:27:30 -0400 Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-751319e0dbfso636576285a.0 for <63082@debbugs.gnu.org>; Fri, 28 Apr 2023 07:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682692050; x=1685284050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G706y8/svulTHnaumUVdPiBiJIyymJf5ckrawe+5/3M=; b=GTy00KuEdDVKMU06NnBt0G6fY6hB0SOYIeWIUDJqQjj4LzZqqBVhNi4WzGdMhDDzh3 +d4GfBrQllGhGPLsTC0T8/oEDkG1JSU3QrwcoF/SajcLO27Os7yfIDgVM8axlj4NuXTv UR3Dm9QRhT+5suvRm0KX9Mi6Qtzj3TlncDWNmkC66jHax/Wy62B71UYavFyWJGFKhHwR sdsY9lhZt8gmDk75oNxNVvAvy0rkUWXhSrq5uBIpcyzfWEBAge/m0dzIJmdMLcn7ckQn 49eXfbimFG9AePhS3K6PjzkihtIe2VN0uRHgdUNE+5bgPq1inIEcEuZHuiX2j21qvJ1S IUQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682692050; x=1685284050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G706y8/svulTHnaumUVdPiBiJIyymJf5ckrawe+5/3M=; b=Szoc50+S3mJTnYDQJHBZrme5sFf9+giqQtYbRTq3X7EexAvtJKaDv/lUxak5vpN3jm NTqhuRZ86VBjAnw1Kdi7RXIg8As1HukGgiBE4Nui9snlShDOeD33UhM/aYbjW2QV3j+q LKYbdq9I0d5D1ULkuBBwMCV/iLZa1NM5GNH1dpD4BubKaMSnne0gFed+HQN1AYV/+xvs nOZ966bRmQwDjftWmQj1f0sBfpRe3xJdpr3OY84h8oGpKPuvdPduWrj2SFSWc8ntWCQ8 3VrAr7h+FLRjTQeB+dyZz7I+wYI/QOeR6xwgIDy8yogOsO+lZqp2vXT6twa+irXXry5P 4NLQ== X-Gm-Message-State: AC+VfDwluqOcQ8gRZGYdxJQFkv1NwqE4O/RJdlabYq3rVS2iZCcIagem FODIGSXbahYW3aOL2nPKc5V9W0vp43Y= X-Google-Smtp-Source: ACHHUZ6FPbBkpIaawdcVDy7aZCInPE+8LfGfnQ6VNS5p3St5PM5/8GCzkyVg9VTMsqcoQpKwIUBvbQ== X-Received: by 2002:ad4:5bac:0:b0:5ef:8b6e:583c with SMTP id 12-20020ad45bac000000b005ef8b6e583cmr8182326qvq.5.1682692049767; Fri, 28 Apr 2023 07:27:29 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id d8-20020a0cfe88000000b005ff569bca72sm6176940qvs.93.2023.04.28.07.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 07:27:29 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 28 Apr 2023 10:27:01 -0400 Message-Id: <6bb4e569bc450907fd412118a6ff43ca22e55f9b.1682690696.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682692106; a=rsa-sha256; cv=none; b=mqzTm5EWOSCqdfI6pGUb1A6mGspLgN1tH/UB5T+tkIXvRAqPvDnyy43ZiJbYN1sAx430QJ 40L7KwnSWFk+NS4mUV4Lv8407d+IN7CJCMrBUMQkEDX50zH/ylw0l97XJ38QDC5Uvhxov/ NphFG09n/A8gzNgGlWcbz3da9uOytZPckMbl7DV7KvjIEt8IT01gU0CdH9hL79qNQV2KPH KYdZ3kekGuNFwuKLF/82zBUmRjymar/KKmCwOITqzF3kEEqW3HF2l8NLnu0OyKCFFDGD73 TqRjGDNHuXVBAdYdjdeHxarC+zh2L3+4JblzoPGz7YsG5vBASvm2KCjPHzC6Fw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20221208 header.b=GTy00KuE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682692106; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0f1ZDo+MW2mA48ddk2vkKG0gA31ctRIKQz67Xj/Jmb0=; b=jGj9Oodczp1dpdoY5QEKPOqLPnDLQN9M0sSbSmP43OlgNBuz1yYxe6vAe1DnvPS/WOthxE zmIAp73uR/VSv4zuk078ssIM93qaD4qcafK3rKUPlTn+3ZoQcoXypobDaIuYyzgzL1saW9 56L0kEb3gqvL5OtExXWGAgHr06qpWD/tAipByZbQGPIPwuH5picbh2PZxzqbySpbUWD+Mr fXgV4rgyqVA9Fbs6PYtvc+2m3byAVeK+loXur06jV+zsUBKSNshuqZWfhumvRgwSgKaTEm t8LFa++AuwMStYhS6RS08IdbKT2+bSX1q7+AN5lF+NCjL+o7GlZQRxjlDahpMg== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20221208 header.b=GTy00KuE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.30 X-Spam-Score: 6.30 X-Migadu-Queue-Id: A9A3B2D18A X-TUID: ciOtwB/W3iLd This is to avoid adding a bogus log rotation job when syslog is used (which already has its own log rotation job). * gnu/services/audio.scm (mpd-log-rotation): Add conditional to avoid producing a log-rotation object when no log-file was provided. (mpd-shepherd-service): Do not manage log file parent directory creation. Assume it already exists. Adjust the rottlog-service-type extension. --- gnu/services/audio.scm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index a1d1a3d2fe..cccf5c2693 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -554,12 +554,15 @@ (define (mpd-serialize-configuration configuration) (serialize-configuration configuration mpd-configuration-fields))) (define (mpd-log-rotation config) - (match-record config (log-file) - (log-rotation - (files (list log-file)) - (post-rotate #~(begin - (use-modules (gnu services herd)) - (with-shepherd-action 'mpd ('reopen) #f)))))) + (match-record config + (log-file) + (if (maybe-value log-file) + (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 @@ -635,7 +638,7 @@ (define mpd-service-type (service-extension account-service-type mpd-accounts) (service-extension rottlog-service-type - (compose list mpd-log-rotation)))) + mpd-log-rotation))) (default-value (mpd-configuration)))) -- 2.39.2