From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yALdG0NGbWJuvAAAbAwnHQ (envelope-from ) for ; Sat, 30 Apr 2022 16:22:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yLZCG0NGbWIClAAAG6o9tA (envelope-from ) for ; Sat, 30 Apr 2022 16:22:59 +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 104FB35EF0 for ; Sat, 30 Apr 2022 16:22:59 +0200 (CEST) Received: from localhost ([::1]:44782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nknzu-0002O1-6q for larch@yhetil.org; Sat, 30 Apr 2022 10:22:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkntC-0006Bc-QX for guix-patches@gnu.org; Sat, 30 Apr 2022 10:16:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkntC-0004Li-HT for guix-patches@gnu.org; Sat, 30 Apr 2022 10:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nkntC-0007T1-8X for guix-patches@gnu.org; Sat, 30 Apr 2022 10:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55080] [PATCH shepherd] service: Gracefully handle non-existing log directories. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Apr 2022 14:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55080 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 55080@debbugs.gnu.org Received: via spool by 55080-submit@debbugs.gnu.org id=B55080.165132814528677 (code B ref 55080); Sat, 30 Apr 2022 14:16:02 +0000 Received: (at 55080) by debbugs.gnu.org; 30 Apr 2022 14:15:45 +0000 Received: from localhost ([127.0.0.1]:58777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nknsu-0007SS-Qo for submit@debbugs.gnu.org; Sat, 30 Apr 2022 10:15:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nknsu-0007SG-6x for 55080@debbugs.gnu.org; Sat, 30 Apr 2022 10:15:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45546) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nknso-0004JQ-Oo; Sat, 30 Apr 2022 10:15:38 -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=vHvVgdnR+6zn59L045OWabG+JFHnCQKgb4OhoFiBArU=; b=E3qZSON98TJUiTXuu8fH qS8a7t3hhjCQfVCUn3otBoDSGqCiIevR28G1je9qfci6+dVxaKk9wTRdvTygmZ77Jy7eisAFu9rYN ZksO2/ToJpgJ/q7jDBKvG5qMj03EDsl3eG+jt/63PPDYVeBUI+QhazzBNw6KIjXPgPjSc2vPdq8XN n+YkA138EXxgXjP1hE+AcjNF31QqqQ2IckxMdGHCT5NTXGtilJr5CqwHa2h6eXOgoPo0cEdTJaJpA McFopjQb9NvCpd9MlI1XspmubGvm1PxHgMaQ44eDWX0HgRAN6+NDlK2y+B7FS+jplwE5JsSgBeWXP 54yvnVkuYhHGbQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:59400 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nknsl-00055q-Ud; Sat, 30 Apr 2022 10:15:38 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <2e5292c2d45e525aa1b8e4c495704104d4121291.camel@gmail.com> Date: Sat, 30 Apr 2022 16:15:33 +0200 In-Reply-To: <2e5292c2d45e525aa1b8e4c495704104d4121291.camel@gmail.com> (Liliana Marie Prikler's message of "Sat, 23 Apr 2022 15:11:50 +0200") Message-ID: <8735hu64je.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-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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651328579; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=vHvVgdnR+6zn59L045OWabG+JFHnCQKgb4OhoFiBArU=; b=FZKGjRjskbMJalU2/W/Ou0rLreGgw7EZLKPDMGRMrYDVUeSqTnV4I6ElxoHr5CmyhOPsVQ QqedlD041XPLG+8LuwQwa+s4KmcvKk60hLn/lgv/WL0rwRXGd2ceKax1Xfzk3jAFqQ2B6B qTqDT4TL6p/Hk1+qpVpeDYwVDqaNkq1AQxwOnPMeiLpIJstSDsXHre24gHp3qHZPazKP+M kYzdD0GJ+SuA2+fSqs/trSwvZbEn7hM6tpkInOsCimTC/JuguUAiFApJcglEonM4sx8l3f jKOx6D3ustn+9wI/eboRe/yB6HIV5uzT/tGcvHuTK3MHolijLb7ZNuXQKmL7Dw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651328579; a=rsa-sha256; cv=none; b=MRjK7N6IcckXtKMPgG2zKxGizFtn7duD1Rkafv3sdA06eO5ipZnwOlAcvchhONYAgVZyzS FKW8Dl99a1wXcPqJmQxJbOCuNO0D3gNlXK4z9lNICTrbcYyjdVD3+kSei/LPOQDStp3XfR 0lBpQxs2XAdrfAL8bE7dii/UPquL3sJNmYZPl+gChwL28yNdvhUx+c6rxJ05GJnZFijDQI nWdtlIuKiHJ4mLcxU6Kcj4Iz/JrSLyH4LwSS4E6Gc6X595NFxZNvh0QKR23q9/pcn5x/TV 2WIe0Pm61kDxQtKdqXbNbZTF5ZrvmzdlDY2I6BJxKT6aGgDTPB8QRJ7qMvwkKQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=E3qZSON9; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=E3qZSON9; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 104FB35EF0 X-Spam-Score: -2.40 X-Migadu-Scanner: scn1.migadu.com X-TUID: OvfB9rTYrudL Hi, Liliana Marie Prikler skribis: > * gnu/packages/services.scm (%service-file-logger): New variable, > implementing... > (service-file-logger): ... the old behaviour of this variable. Catch sys= tem > errors from %service-file-logger and handle them. [...] > +(define (service-file-logger file input) > + "Return a thunk meant to run as a fiber that reads from INPUT and logs= it to > +FILE." > + (catch 'system-error > + (lambda () > + (%service-file-logger file input)) > + (lambda args > + (if (=3D ENOENT (system-error-errno args)) > + (begin > + (mkdir-p (dirname file)) > + (%service-file-logger file input)) > + (apply throw args))))) I wonder to what extent automatically creating log directories is a good idea. A potential drawback is if shepherd creates them with unexpected ownership or permissions. Did you encounter this issue while working on services? Am I right that the Shepherd 0.8 had the same problem? Thanks, Ludo=E2=80=99.