From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id INB3Lt84wWQ+PQEASxT56A (envelope-from ) for ; Wed, 26 Jul 2023 17:16:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +A4+Lt84wWQOGQAAauVa8A (envelope-from ) for ; Wed, 26 Jul 2023 17:16:47 +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 59DFA56E06 for ; Wed, 26 Jul 2023 17:16:47 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1690384607; 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=2qSuG6IGPJLDI9itq3DrByu6nLluPTAA3HCVeBl/t+E=; b=lHbDBgQbn4XpqavIN+OK+MW9k+OfkiPCaY4pgFpZ7mPiNzewon8motKHrUekVQ4P//m6xG lr224jtKoZbWFUpPkzz6CXC38k/RTs/qZdMQF5kJNHDsWGOZr/wmdsE2OHYEuPz88K4xb1 DJzFyWgcmutVyfgPkhiQjmY5/36FgJIBpCqQUZ4DzzUTeUplVQw2moRSPy3WmNBQFhTYHb d0qcsyy/OXGWvp7ZYviROC3FeCrsXtOxifw+eNE7xljyVP6Yz6GSk/rdebRFhCtzvw/aOU BXdUB+eGY8A9FrN9DmI4zpr04/mIVJ68tSiOI+P2HtoavLUYZiPehHHbPqUM+w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1690384607; a=rsa-sha256; cv=none; b=EjUvloTAsauioP9rWcjiTpP4w28YLKxFasTihw/NcP/f/ZdWz45RdMpyjiF7WLf8+ZXT2q aVGaQAujDCcQzk7uer4c+1zyWl/8Y2Qget3E+iOgATFZURiLLuP4EW0PJogrihxVxsOMH8 bcgmYbsVuoUq0KqbOigQL80Xpn5BrlMDpbfpXPnGBON0Qb86OH3gXN140xx0phocMxp8pY 5FVdiUKM4YOSYfkQ14ZIJSzvt9F9HKbjOKWdRaDhuAlwlwdhltvnPF6PBGi5/ho2nGtj+8 pMdiZzqM14NhrWMzxJ5VXjw4Bilwtkw+b2Mxq59C66EjmJzswfUB99sodrIXVg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOf73-0004U7-BT; Wed, 26 Jul 2023 10:03:37 -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 1qOf6U-0004S2-Sd for bug-guix@gnu.org; Wed, 26 Jul 2023 10:03:02 -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 1qOf6U-0002uN-Kd for bug-guix@gnu.org; Wed, 26 Jul 2023 10:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qOf6U-0001Hz-Fi for bug-guix@gnu.org; Wed, 26 Jul 2023 10:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63082: mpd defaul configuration does not work ('No database' error) Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 26 Jul 2023 14:03:02 +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.16903801504915 (code B ref 63082); Wed, 26 Jul 2023 14:03:02 +0000 Received: (at 63082) by debbugs.gnu.org; 26 Jul 2023 14:02:30 +0000 Received: from localhost ([127.0.0.1]:49698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qOf5y-0001HC-7G for submit@debbugs.gnu.org; Wed, 26 Jul 2023 10:02:30 -0400 Received: from smtpm5.myservices.hosting ([185.26.105.236]:40034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qOf5w-0001H4-3a for 63082@debbugs.gnu.org; Wed, 26 Jul 2023 10:02:28 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm5.myservices.hosting (Postfix) with ESMTP id 9BFD020C82; Wed, 26 Jul 2023 16:02:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 1AE2D8009D; Wed, 26 Jul 2023 16:02:23 +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 daBITzpdvqLY; Wed, 26 Jul 2023 16:02:22 +0200 (CEST) Received: from [192.168.1.116] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 6F7368009C; Wed, 26 Jul 2023 16:02:22 +0200 (CEST) Message-ID: Date: Wed, 26 Jul 2023 15:02:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US References: <685ac37d86b0e8eb135c5e40aa1f89240c2b4934.1683299529.git.maxim.cournoyer@gmail.com> <927eb9f7-17e6-136d-8fbc-ab1e5d5bb87b@makinata.eu> <87cz0f1zvv.fsf_-_@gmail.com> From: Bruno Victal In-Reply-To: <87cz0f1zvv.fsf_-_@gmail.com> Content-Type: text/plain; charset=UTF-8 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-Spam-Score: -6.15 X-Migadu-Queue-Id: 59DFA56E06 X-Migadu-Spam-Score: -6.15 X-Migadu-Scanner: mx0.migadu.com X-TUID: uccciNQftiJN Hi Maxim, On 2023-07-25 21:48, Maxim Cournoyer wrote: > Hi Bruno, > > Bruno Victal writes: > >> Hi Maxim, >> >> On 2023-05-05 19:28, Maxim Cournoyer wrote: >>> * gnu/services/audio.scm (mpd-shepherd-service): Register a new update action. >>> * doc/guix.texi (Audio Services): Document it. >>> --- >>> doc/guix.texi | 10 ++++++++++ >>> gnu/services/audio.scm | 11 +++++++++++ >>> 2 files changed, 21 insertions(+) >>> >> >> I've been looking at this part for the past few weeks in attempt to >> make it more robust and after countless hours, I'd advise against this >> (in its current form), reason being that this only works if your >> configuration happens to match the default values used by mpc. >> >> My attempts at getting the values from the configuration into >> something that mpc understands have been unsuccessful. Not only the >> decision “logic” of what values to pass is non-trivial, parsing the >> endpoints field has been so far a complete nightmare. (with interesting >> gems like IPv6 address formats that the daemon is happy to use yet >> mpc will reject) >> >> Having the proper hostname (and port) intelligently deduced from >> the endpoints field is a big minefield that is likely to end in >> unmaintainable spaghetti. >> >> Short of introducing additional fields like “internal-mpc-host” and >> “internal-mpc-port”, you could modify this to relay the >> 'environment-variables' field for mpc as well. (since it can make use >> of the MPD_HOST and MPD_PORT varibles if present) > > Apologies if it's been a couple weeks, but was the above comment really > meant for patch 02/16 of this series ("services: mpd: Add an 'update' > action to trigger a database update.") ? I don't see how they relate. Yes, since this action uses 'mpc' to issue the 'update' command and the way it works is that mpc is using a 'default' value to connect to MPD. The 'default' works until you change the 'endpoints' to something that _doesn't_ match the defaults that 'mpc' uses (e.g. [fe80::1234%eno1], /var/run/mpd/not-your-expected-name.socket, 2001:db8::1, etc.) Since the 'endpoints' field is equivalent to MPDs 'bind_to_address' directive [1], you have to take into account the flexible formats it allows and the 'port' field as well. This makes it somewhat non-trivial to inspect the 'endpoints' and 'port' fields to select an address for the shepherd 'update' action to use. You also need to take into account that you have to pass the address and port separately (if needed) for 'mpc'. One additional avenue (from the ones originally listed) we could explore is to make the endpoints field no longer a maybe-type. We set a default value (that is aligned with upstream, like localhost:6600) and also set an “internal” unix socket to be used primarily by shepherd. [1]: -- Furthermore, I consider that nonfree software must be eradicated. Cheers, Bruno.