From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 8IZMLaZCTGTNSAEASxT56A (envelope-from ) for ; Sat, 29 Apr 2023 00:03:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AAI/LaZCTGSq/gAA9RJhRA (envelope-from ) for ; Sat, 29 Apr 2023 00:03:18 +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 8AD06467B8 for ; Sat, 29 Apr 2023 00:03:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psWBD-0001CX-GC; Fri, 28 Apr 2023 18:03:03 -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 1psWBC-0001CP-JP for bug-guix@gnu.org; Fri, 28 Apr 2023 18:03:02 -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 1psWBC-0000dr-Ac for bug-guix@gnu.org; Fri, 28 Apr 2023 18:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1psWBB-0002rD-Ul for bug-guix@gnu.org; Fri, 28 Apr 2023 18:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63082: [PATCH 07/17] services: mpd: Log to syslog by default. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 28 Apr 2023 22:03:01 +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: Maxim Cournoyer Cc: 63082@debbugs.gnu.org Received: via spool by 63082-submit@debbugs.gnu.org id=B63082.168271936310952 (code B ref 63082); Fri, 28 Apr 2023 22:03:01 +0000 Received: (at 63082) by debbugs.gnu.org; 28 Apr 2023 22:02:43 +0000 Received: from localhost ([127.0.0.1]:34683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psWAq-0002qW-IY for submit@debbugs.gnu.org; Fri, 28 Apr 2023 18:02:43 -0400 Received: from smtpm3.myservices.hosting ([185.26.105.234]:53460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1psWAa-0002q6-8f for 63082@debbugs.gnu.org; Fri, 28 Apr 2023 18:02:37 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id 87A8120ECA; Sat, 29 Apr 2023 00:02:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 28ADE80097; Sat, 29 Apr 2023 00:02:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qFSBvXtAj6oJ; Sat, 29 Apr 2023 00:02:21 +0200 (CEST) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id B8EF480060; Sat, 29 Apr 2023 00:02:21 +0200 (CEST) Message-ID: <93e9013b-561a-0549-bf84-9752796e5c4a@makinata.eu> Date: Fri, 28 Apr 2023 23:02:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US References: <44c9a5cf9836a71db9bf78c2eba005a40a006fff.1682690696.git.maxim.cournoyer@gmail.com> From: Bruno Victal In-Reply-To: <44c9a5cf9836a71db9bf78c2eba005a40a006fff.1682690696.git.maxim.cournoyer@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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=1682719398; a=rsa-sha256; cv=none; b=cWhHWb3sPf21FHMobtuN+fDRfXWvp4hdGRQTsZsKYu7zgbOcYPBTj4fTPsYVXUQQIu5bA4 70ZVL0bkAJkNOSmrDyDEUhOF/Hv6Ew2wFBuX4zH5T+WMYtop3UEeqKUES/noaJoIu7Tqp7 sUiu75XmV4/W6WMf0PNMknHMDds6FOKe1PUOBk1IUsrn7cmRvJkZguf1EcDn+tot5afDhH L+3XDFAO2WJ4yBIXNefSTf6JRP98ni7xc5EB60e1NNxHIXuVlyvicgeK6cTxh4PP8ipD3u xjwsKzTQRlB772uQnMJw/ci4gaVEADG4j4ZmKOnSyktPJIwxzCs5WGcZmZ8avA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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=1682719398; 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; bh=QBRsOo/Dmvv+zatq21smJBFN4eWXUbnS9Y5XURhPZdE=; b=GJcMP1fp3SBcbb66musMTVryR+dIDinZpE4TcFxflGCwGIyck9gyaIy19qblbxo3Spbz9I mr/upOWF0UN9acbFG2J3xVHkIxdpx8Q+RwO9RyEtuwH4yH6KZlUxEXSjdCrjHMilJ9K2pH MRhmQvs+J4IQ/fUz+tIsTHBHQXXWryJwBREtLf9RrCRa5kcHTseWkFnqA9G8ONLOOwyidX plDFDqwvccFuEwpsgrtN6B5ekAs9XBwdFwW2lhSLg+88vyiMvl4tOcjfdubatS0JR4pFFM 4SLiYnevEUtax1Zb/gACVQBXDt6fitejNR1xgC77MgsOLEVddH8D5tZXuRSkkw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: -3.20 X-Spam-Score: -3.20 X-Migadu-Queue-Id: 8AD06467B8 X-TUID: 3ZSYfiqgN6JT On 2023-04-28 15:27, Maxim Cournoyer wrote: > Rationale: the tristate value was awkward to deal with, the default log file > name was odd (/var/log/mpd/log) and it required special attention to create > the 'mpd' parent directory as root and chowning it to the MPD user. It also > didn't match the default behavior of MPD, which is to log to systemd or syslog > unless a log file is specified. > > * gnu/services/audio.scm (mpd-log-file-sanitizer): New procedure. > (mpd-configuration) [log-file]: Remove default maybe value. Add sanitizer. > (mpd-shepherd-service): Validate the log file parent directory exists and has > the right permissions. > * doc/guix.texi (Audio Services): Update doc. How about a similar approach taken in mympd for handling the logging parameter? In any case, I'd like to remind you that mpd-service-type also has a rottlog service extension so that also needs to be taken into account. > (log-level > maybe-string > @@ -563,17 +573,18 @@ (define (mpd-shepherd-service config) > (requirement `(user-processes loopback ,@shepherd-requirement)) > (provision '(mpd)) > (start #~(begin > - (and=> #$(maybe-value log-file) > - (compose mkdir-p dirname)) > - > (let ((user (getpw #$username))) > (for-each > (lambda (x) > - (when (and x (not (file-exists? x))) > + ;; Take action on absolute file names, to filter out > + ;; the 'syslog' special value. > + (when (and x (string-prefix? "/" x) > + (not (file-exists? x))) > (mkdir-p x) > (chown x (passwd:uid user) (passwd:gid user)))) I'd use mkdir-p/perms from (gnu build activation) instead.