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 ms13.migadu.com with LMTPS id yMEHKDHWIGfzawEAqHPOHw:P1 (envelope-from ) for ; Tue, 29 Oct 2024 12:33:53 +0000 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 yMEHKDHWIGfzawEAqHPOHw (envelope-from ) for ; Tue, 29 Oct 2024 13:33:53 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=LA31WXf5; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=VOSjbKpb; dmarc=fail reason="SPF not aligned (strict), DKIM not aligned (strict)" header.from=posteo.net (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-Seal: i=1; s=key1; d=yhetil.org; t=1730205233; a=rsa-sha256; cv=none; b=dpfzDvNRpLLXijzO3qMhHWjpVqfr80WpOr8fmT8vXGnJ6CzIraLFFtz+xUJhfC+N1bWnIt QG9y5gBlFIAdigGuZeZNIp8eFCCRlOm4WAMiY17gLRhKJoC6U4ogTYu1P6XptC7d6C4JBt vpcpaNrVoqdhIOsYc9S5sCeWDXnw0FliVFPZldtskrWVQ81dknndUncXC3gaMu6/yzERf9 oxgECkYNTFpxvXWG70t4xP/1698JpQqaLNuao+LR/CXYz51MdwQyXYsePCzY4n8/HcOAAz lOThR0TOzimJ/6MQxak2Cw1tH8xpvmdXVfzAXzUdyuwHfu6gNdMPRkfVUOUi+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=LA31WXf5; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=VOSjbKpb; dmarc=fail reason="SPF not aligned (strict), DKIM not aligned (strict)" header.from=posteo.net (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=1730205233; 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=DWX6osqCyPBcosZfQXxqS248by2YXR9th8BXQKvUSvE=; b=iKyJw/sv0+n/pur0VNP5F0A1Yz7y7yDA2C7Jf68/hNh+Ybzz48F8qCae4Ougtf+GB48d/b ZRjpwNheIaGxisbqov3qi+klKUlRH1z7siX8eDNIgXBaKjPgBeeRVUpX619dbnP4AdhqX5 WNx38Myj3+9y/gOI1AV8s6R6vUVL+qdTFKxakhRzNlKQfPZtNO/kfotLwkhKWxaxhr3+Hr Lgvpw7eHslRe41QJREOf6T1Zu+GAY4ad/3NJy+WN4PkaOIsWw4iqXu4eTPV0/RJaVjZkdi PdI2z/mGpKEkRA+oB4ew3exzX3tUUvpDKMVN/f8X2WbYMllIwtRbwEn+31v8wA== 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 C994B19FE8 for ; Tue, 29 Oct 2024 13:33:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5lPG-0002IS-49; Tue, 29 Oct 2024 08:33:06 -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 1t5lPD-0002II-KW for bug-guix@gnu.org; Tue, 29 Oct 2024 08:33:03 -0400 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 1t5lPD-0001FG-2P for bug-guix@gnu.org; Tue, 29 Oct 2024 08:33:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=DWX6osqCyPBcosZfQXxqS248by2YXR9th8BXQKvUSvE=; b=LA31WXf5EaNn1zeWXyOz+H4NTQMlPYg2qNs9N/eFSqtaJjiCUD/lXNgzPWu+3Oqk38chg1shczpLitDNVuxxP+hq/cGj/oEjQovjOV2xuQGHb4sBm3LhwbPLp2VSGpysKgzdmztXXTa1jR+ts4BFsRTfZsHiQ0VVihNKgkeFhlWUt0bRmHxmB7jtSnTjfIHrNQE6VxYseBmVHjhzbyqn2eJ2eP/ijNWh6/IWo3P3JDNgfW9f4bZjUH6ZWExOYIeSMQXZf3jbVchkcfr0DJm7RUNpHDvQHimOrWaNMMjJFy0TLQL90X0vuYWx+o4BY5InNsO1cXlRS19m34NGzyFgNA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5lPB-0002ur-Vt for bug-guix@gnu.org; Tue, 29 Oct 2024 08:33:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#74082: [PATCH] home: Use %user-log-dir as the log directory for all services. References: In-Reply-To: Resent-From: Dariqq Original-Sender: "Debbugs-submit" Resent-CC: , bug-guix@gnu.org Resent-Date: Tue, 29 Oct 2024 12:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74082 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 74082@debbugs.gnu.org Cc: Dariqq , ngraves@ngraves.fr, ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tanguy Le Carrour X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tanguy Le Carrour Received: via spool by 74082-submit@debbugs.gnu.org id=B74082.173020513311196 (code B ref 74082); Tue, 29 Oct 2024 12:33:01 +0000 Received: (at 74082) by debbugs.gnu.org; 29 Oct 2024 12:32:13 +0000 Received: from localhost ([127.0.0.1]:56314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5lOO-0002uW-Ee for submit@debbugs.gnu.org; Tue, 29 Oct 2024 08:32:12 -0400 Received: from mout02.posteo.de ([185.67.36.66]:46731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5lOL-0002uO-Ef for 74082@debbugs.gnu.org; Tue, 29 Oct 2024 08:32:11 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E089D240103 for <74082@debbugs.gnu.org>; Tue, 29 Oct 2024 13:32:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1730205121; bh=0/Fj1NP82YkmfsceISpgmx9xREmWbzQuGsfVuJGm8CI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=VOSjbKpb/GXnVSmqPWoVzHM6b6rhOKSocaCgJ3+lllfy3l4M0gipWSZhO0fRyezSO APRa+Ts5FrM6hlW7qVkNn1pLDWz5BOaPHJEMmrrJrxSf8z/E3a+I6z7ZJist8JA2X/ Y3nar9h49xnQYeFHst61mnNvt7xJxySe1GwOPEZBEHnsxmzjdZyOlyrHDASEvToevb g6xLZ037wRbyAclbdEQk2OaAIXXLW/6uzXjbV1QJl5WI9CIxUOZawico0uL0CHDmHG vCZ7L51jXtEBVho9thmBdqPK7KYIDHR+Hq1GHoSIWwde6KuubW/4jPI3I6lDeXTf2U yeNotwnQEngqg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Xd8lN6dkHz9rxL; Tue, 29 Oct 2024 13:32:00 +0100 (CET) From: Dariqq Date: Tue, 29 Oct 2024 12:29:04 +0000 Message-ID: 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 X-Migadu-Spam-Score: -0.02 X-Spam-Score: -0.02 X-Migadu-Queue-Id: C994B19FE8 X-Migadu-Scanner: mx12.migadu.com X-TUID: b8Fmrrgt6Dzf * gnu/home/services/desktop.scm (home-dbus-shepherd-services): Log to %user-log-dir. * gnu/home/services/desktop.scm (home-unclutter-shepherd-services): Same. * gnu/home/services/pm.scm (home-batsignal-shepherd-services): Same. * gnu/home/services/shepherd.scm (launch-shepherd-gexp): Don't overwrite default log-file. Change-Id: I2742371cbddd1bf4d981efc41f3eae8f148336be --- This patch fixes the inconsistent use of "LOCAL_STATE_HOME/log/" vs "LOCAL_STATE_HOME/shepherd/" for logfiles by changing the (remaining) shepherd services to the shepherd variable %user-log-dir i.e. LOCAL_STATE_DIR/shepherd. I also removed the --log-file argument from the autostart shepherd invocation which makes it log to the default location LOCAL_STATE_DIR/shepherd/shepherd.log and removed creation of the shepherd log dir. (comment says shepherd >= 0.9.2 should handle creation of the directory) Have only tested it with dbus-service and the autostart shepherd because I dont use the other ones. There is still another slight inconsistency with other home-services that let-bind the logdir, but this is less of an issue imo. gnu/home/services/desktop.scm | 16 ++++++---------- gnu/home/services/pm.scm | 8 +++----- gnu/home/services/shepherd.scm | 18 +++++------------- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm index dc9de168b7..fc96ce9295 100644 --- a/gnu/home/services/desktop.scm +++ b/gnu/home/services/desktop.scm @@ -298,6 +298,7 @@ (define (home-dbus-shepherd-services config) (list (shepherd-service (documentation "Run the D-Bus daemon in session-specific mode.") (provision '(dbus)) + (modules '((shepherd support))) ;for '%user-log-dir' (start #~(make-forkexec-constructor (list #$(file-append (home-dbus-dbus config) "/bin/dbus-daemon") @@ -310,10 +311,7 @@ (define (home-dbus-shepherd-services config) (cons "DBUS_VERBOSE=1" (default-environment-variables)) #:log-file - (format #f "~a/log/dbus.log" - (or (getenv "XDG_STATE_HOME") - (format #f "~a/.local/state" - (getenv "HOME")))))) + (string-append %user-log-dir "/dbus.log"))) (stop #~(make-kill-destructor))))) (define (home-dbus-environment-variables config) @@ -352,7 +350,8 @@ (define (home-unclutter-shepherd-service config) ;; Depend on 'x11-display', which sets 'DISPLAY' if an X11 server is ;; available, and fails to start otherwise. (requirement '(x11-display)) - (modules '((srfi srfi-1) + (modules '((shepherd support) ;for %user-log-dir + (srfi srfi-1) (srfi srfi-26))) (one-shot? #t) (start #~(lambda _ @@ -369,11 +368,8 @@ (define (home-unclutter-shepherd-service config) (cons (string-append "DISPLAY=" (getenv "DISPLAY")) (remove (cut string-prefix? "DISPLAY=" <>) (default-environment-variables))) - #:log-file (string-append - (or (getenv "XDG_STATE_HOME") - (format #f "~a/.local/state" - (getenv "HOME"))) - "/log/unclutter.log"))))))) + #:log-file + (string-append %user-log-dir "/unclutter.log"))))))) (define home-unclutter-service-type (service-type diff --git a/gnu/home/services/pm.scm b/gnu/home/services/pm.scm index d8361fd214..00e3138508 100644 --- a/gnu/home/services/pm.scm +++ b/gnu/home/services/pm.scm @@ -88,6 +88,7 @@ (define (home-batsignal-shepherd-services config) (list (shepherd-service (provision '(batsignal)) (documentation "Run the batsignal battery-watching daemon.") + (modules '((shepherd support))) ;for '%user-log-dir' (start #~(make-forkexec-constructor (append (list #$(file-append batsignal "/bin/batsignal") "-w" (number->string #$warning-level) @@ -127,11 +128,8 @@ (define (home-batsignal-shepherd-services config) (if #$ignore-missing? (list "-i") (list))) - #:log-file (string-append - (or (getenv "XDG_STATE_HOME") - (format #f "~a/.local/state" - (getenv "HOME"))) - "/log/batsignal.log"))) + #:log-file + (string-append %user-log-dir "/batsignal.log"))) (stop #~(make-kill-destructor)))))) (define home-batsignal-service-type diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm index 5ea8462020..034a7837ef 100644 --- a/gnu/home/services/shepherd.scm +++ b/gnu/home/services/shepherd.scm @@ -120,19 +120,11 @@ (define (launch-shepherd-gexp config) (or (getenv "XDG_RUNTIME_DIR") (format #f "/run/user/~a" (getuid))) "/shepherd/socket")) - (let* ((state-dir (or (getenv "XDG_STATE_HOME") - (format #f "~a/.local/state" - (getenv "HOME")))) - (log-dir (string-append state-dir "/log"))) - ;; TODO: Remove it, 0.9.2 creates it automatically? - ((@ (guix build utils) mkdir-p) log-dir) - (system* - #$(file-append shepherd "/bin/shepherd") - "--logfile" - (string-append log-dir "/shepherd.log") - #$@(if silent? '("--silent") '()) - "--config" - #$(home-shepherd-configuration-file config))))) + (system* + #$(file-append shepherd "/bin/shepherd") + #$@(if silent? '("--silent") '()) + "--config" + #$(home-shepherd-configuration-file config)))) #~""))) (define (reload-configuration-gexp config) base-commit: 4491dec50a97dbdebd7dd6d41a5596358b155b79 -- 2.46.0