From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 07:53:54 2023 Received: (at submit) by debbugs.gnu.org; 17 Feb 2023 12:53:54 +0000 Received: from localhost ([127.0.0.1]:38756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT0FO-0001lA-FL for submit@debbugs.gnu.org; Fri, 17 Feb 2023 07:53:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:58414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT0FN-0001l4-Kl for submit@debbugs.gnu.org; Fri, 17 Feb 2023 07:53:54 -0500 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 1pT0FN-0000iR-Ek for bug-guix@gnu.org; Fri, 17 Feb 2023 07:53:53 -0500 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pT0FL-00060p-RJ for bug-guix@gnu.org; Fri, 17 Feb 2023 07:53:53 -0500 Received: by mail-qv1-xf33.google.com with SMTP id ks14so1598740qvb.11 for ; Fri, 17 Feb 2023 04:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=x3w+yk5YJdVBv2mhlRWWMjB+AiLUsyG6mlH4tth47RU=; b=QkQyMEE5K0Lc8Ou9uyy/qINdQ2ggfJO6leJbyplrG1zxwfBRhY8UQV2n/m0ADP74wQ el68h00FARGtW3CWKDrFovRMXYkSRMioIjTpjvilJliH9wAG3cwUEUW5sUwqZMyFGt3z mqBnP5qn7v4nbswx+fSKV2C80dKe+dx7NMJbTLRUMIoOjedcTw4q5Lp5yLfrDFozMdUM oyTK6Vsf+e6pQw7y/Eob+u0g+zRlRFvdGsj3/3YT18v6OW/jgiCLTw8y2+risoLlYqbR V+yMbsrP+80pxNZn8vUuAgo5wJ3qJ6KDcWHIiacoT4fzS0PSIu60iiDjq7fkaBYI7mf6 wwtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x3w+yk5YJdVBv2mhlRWWMjB+AiLUsyG6mlH4tth47RU=; b=PXeXav4Er/Lu/YrXpMAK4yFMaFny8XGc9LKc+6l1q2gZkQpafu4SWi8XriwMu31iLF rpclpXRsqoVnLA6xE7DbIb3yLwhDWc1LMxkoIJ/LZiMZDsiyV9Qb+5S7xK5cnV4odEha ts60dSKzdvv721loPsTKtpI7u0ZIgk3aTVK+i0etJSixZ4aixOYfQxpN0O7s5OUPxlu0 zQApalrYyCegUSKyw+45c5UksH74jkRWZ+VZACUAnx3HzN56jOX13AXS6rHOLRAPScf1 PhHdBjER9WeLmht9M8JH2V2pUQUTnE2qJvJHCdopFq0Z09+8wZ2YLxYxrK1lG8F4Vou6 0nUQ== X-Gm-Message-State: AO0yUKUWXstdP9FQTlPS6896CIKntgOu44fvIOMjo6ZX+QB4eWY5CWtw owr3Ff7c79m01q5xU3yrw6fS698AbAefATJc X-Google-Smtp-Source: AK7set/lf7telc/lf9aI1RUxV0KSaqHlJslKjIprGhL+TiW/TslDdQrCFUacTquVGm1DZ8HEG91dZw== X-Received: by 2002:a05:6214:20c7:b0:56e:9ab5:cd9f with SMTP id 7-20020a05621420c700b0056e9ab5cd9fmr2018036qve.39.1676638430483; Fri, 17 Feb 2023 04:53:50 -0800 (PST) Received: from hurd (dsl-157-123.b2b2c.ca. [66.158.157.123]) by smtp.gmail.com with ESMTPSA id p71-20020a37424a000000b0073b275607f0sm3204232qka.65.2023.02.17.04.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 04:53:50 -0800 (PST) From: Maxim Cournoyer To: bug-guix Subject: Backward incompatible changes in mpd-service-type Date: Fri, 17 Feb 2023 07:53:48 -0500 Message-ID: <87y1owsbab.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::f33; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Liliana Prikler , Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi! I wanted to note some findings regarding the improved mpd-configuration/mdp-service-type (thanks!) (5c5f0fc1135ff15f9c4adfc5f27eadd9a592b5d1, "services: mpd: Refactor MPD service.") after having reconfigured my machine yesterday. I've noted these two backward incompatible changes: 1. the mixer type must now be a string instead of a symbol, and takes "none" instead of 'null for the null mixer: --8<---------------cut here---------------start------------->8--- @@ -239,7 +239,7 @@ (mpd-output (name "streaming") (type "httpd") - (mixer-type 'null) + (mixer-type "none") (extra-options `((encoder . "lame") (port . "6601") --8<---------------cut here---------------end--------------->8--- It'd be nice if there was some deprecation warning and automatic healing code for now. The doc should also be updated, because it still mention the @code{null} value: --8<---------------cut here---------------start------------->8--- =E2=80=98mixer-type=E2=80=99 (default: =E2=80=98"none"=E2=80=99) (type= : string) This field accepts a string that specifies which mixer should be used for this audio output: the =E2=80=98hardware=E2=80=99 mix= er, the =E2=80=98software=E2=80=99 mixer, the =E2=80=98null=E2=80=99 mixe= r (allows setting the volume, but with no effect; this can be used as a trick to implement an external mixer External Mixer) or no mixer (=E2=80=98none=E2= =80=99). --8<---------------cut here---------------end--------------->8--- 2. The MPD user appears to be created instead of using an existing one. I was using my own account, like this: --8<---------------cut here---------------start------------->8--- (service mpd-service-type (mpd-configuration (user "maxim") (address "0.0.0.0") (outputs (list (mpd-output) (mpd-output (name "streaming") (type "httpd") (mixer-type "none") (extra-options `((encoder . "lame") (port . "6601") (bitrate . "320")))))))) --8<---------------cut here---------------end--------------->8--- and 'guix system reconfigure' is now warning that a user is defined twice, and my user description following reconfiguration is: "Music Player Daemon (MPD) user" :-). Perhaps it should check if a user already exists and not add it if it does? Else an error rather than a warning when multiple same-name users are defined would be more appropriate, I think. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 10:33:56 2023 Received: (at submit) by debbugs.gnu.org; 17 Feb 2023 15:33:56 +0000 Received: from localhost ([127.0.0.1]:41049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT2kF-0005Fg-PN for submit@debbugs.gnu.org; Fri, 17 Feb 2023 10:33:56 -0500 Received: from lists.gnu.org ([209.51.188.17]:40348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT2kE-0005FW-6W for submit@debbugs.gnu.org; Fri, 17 Feb 2023 10:33:54 -0500 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 1pT2kD-0000bN-US for bug-guix@gnu.org; Fri, 17 Feb 2023 10:33:54 -0500 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pT2kB-0007Pb-Eh for bug-guix@gnu.org; Fri, 17 Feb 2023 10:33:53 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 7D74F20D9E; Fri, 17 Feb 2023 16:33:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 2D9B680098; Fri, 17 Feb 2023 16:33:36 +0100 (CET) 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 thlbjadddlNs; Fri, 17 Feb 2023 16:33:35 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7B7EF80079; Fri, 17 Feb 2023 16:33:35 +0100 (CET) Message-ID: <8c7394ba-b8fa-eac5-7d3e-3d8160b71894@makinata.eu> Date: Fri, 17 Feb 2023 15:33:35 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: Backward incompatible changes in mpd-service-type Content-Language: en-US To: Maxim Cournoyer References: <87y1owsbab.fsf@gmail.com> From: Bruno Victal In-Reply-To: <87y1owsbab.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.107.241; envelope-from=mirai@makinata.eu; helo=smtpmciv5.myservices.hosting X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.256, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: submit Cc: Liliana Prikler , bug-guix X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) Hi Maxim, On 2023-02-17 12:53, Maxim Cournoyer wrote: > Hi! > > I wanted to note some findings regarding the improved > mpd-configuration/mdp-service-type (thanks!) > (5c5f0fc1135ff15f9c4adfc5f27eadd9a592b5d1, "services: mpd: Refactor MPD > service.") after having reconfigured my machine yesterday. I've noted > these two backward incompatible changes: > > 1. the mixer type must now be a string instead of a symbol, and takes > "none" instead of 'null for the null mixer: Indeed, this was an unintentional API breakage. IMO taking symbols here always stood out since most of the fields were happy taking strings as values. A deprecated warning and a symbol->string can be added here for compatibility. > --8<---------------cut here---------------start------------->8--- > @@ -239,7 +239,7 @@ > (mpd-output > (name "streaming") > (type "httpd") > - (mixer-type 'null) > + (mixer-type "none") > (extra-options > `((encoder . "lame") > (port . "6601") > --8<---------------cut here---------------end--------------->8--- > > It'd be nice if there was some deprecation warning and automatic healing > code for now. The doc should also be updated, because it still mention > the @code{null} value: > > --8<---------------cut here---------------start------------->8--- > ‘mixer-type’ (default: ‘"none"’) (type: string) > This field accepts a string that specifies which mixer should > be used for this audio output: the ‘hardware’ mixer, the > ‘software’ mixer, the ‘null’ mixer (allows setting the volume, > but with no effect; this can be used as a trick to implement > an external mixer External Mixer) or no mixer (‘none’). > --8<---------------cut here---------------end--------------->8--- There's no mistake here, 'null' mixer is distinct from 'none' mixer. > 2. The MPD user appears to be created instead of using an existing > one. I was using my own account, like this: > > --8<---------------cut here---------------start------------->8--- > (service mpd-service-type > (mpd-configuration > (user "maxim") > (address "0.0.0.0") > (outputs > (list (mpd-output) > (mpd-output > (name "streaming") > (type "httpd") > (mixer-type "none") > (extra-options > `((encoder . "lame") > (port . "6601") > (bitrate . "320")))))))) > --8<---------------cut here---------------end--------------->8--- > > and 'guix system reconfigure' is now warning that a user is defined > twice, [...] This is an unfortunate situation arising from a bug before the service was refactored. Before d7fd9ec209f72e9cfff04a48bf16e092f258d8ff (actually 5c5f0fc1135ff15f9c4adfc5f27eadd9a592b5d1) mpd-service-type contained a service-extension for %mpd-accounts where the values for both group and user were hardcoded to "mpd" but this was actually never used since shepherd would launch the service using root and mpd would downgrade its permissions and switch to the user specified in the mpd-configuration record since this field is serialized to the configuration file. No "warning for user defined twice" would show precisely because the service-extension %mpd-accounts for account-service-type was hardcoded, unless your "user-account" happened to be named "mpd". %mpd-accounts being hardcoded also meant that the mpd-service-activation procedure made little sense. (since it was chown'ing and chmod'ing directories from the "mpd" user to the value in the 'user' field from mpd-configuration record type) > [...] and my user description following reconfiguration is: "Music > Player Daemon (MPD) user" :-). AFAIK, the 'users' (resp. 'groups') fields from the 'operating-system' record type do not have precedence over account-service-type service extensions (though this should be the case) so it's "whoever remains" after duplicates are filtered out, which in this case mpd-service-type happened to "win the race". I'd expect this behavior to happen with any service whose configuration record-type contains a user (resp. group) field that is relayed to a account-service-type service-extension. (examples would be some of the git services if I'm not mistaken) Another way to trigger this is with 'radicale', by manually creating the 'radicale' user in 'operating-system' (say that you want to change the HOME directory since its where the data is saved to) and adding 'radicale-service-type' to 'services'. > Perhaps it should check if a user already exists and not add it if it > does? Else an error rather than a warning when multiple same-name users > are defined would be more appropriate, I think. I don't think service definitions have access to the operating-system field, this was one of the hurdles when #60735 was being tackled. IMO, this "issue" is avoided by not using the mpd-service-type as a "home service", which is what you're trying to do when you pass it your own "interactive" user account. Forcing mpd-service-type as a home service is fraught with subtle peculiarities, one of them was noted in commit message 637a9c3b264fe8eb76b6ed9f104b635d95632be6 and was discussed in #59866. This service should be used "system-wide", which could be streaming oriented setups (via HTTP, icecast, PulseAudio + rtp, ...) or system-wide PulseAudio. (not recommended) "Home service" use cases should get its own home service definition, either by reusing many of the record-types and procedures here or simply by inheriting and selectively deleting some of the service extensions. (such as account-service-type) Cheers, Bruno From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 17 13:07:01 2023 Received: (at 61570) by debbugs.gnu.org; 17 Feb 2023 18:07:02 +0000 Received: from localhost ([127.0.0.1]:41521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT58P-0003js-Fr for submit@debbugs.gnu.org; Fri, 17 Feb 2023 13:07:01 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT58N-0003jZ-8A for 61570@debbugs.gnu.org; Fri, 17 Feb 2023 13:07:00 -0500 Received: by mail-wm1-f66.google.com with SMTP id l25so2162965wms.1 for <61570@debbugs.gnu.org>; Fri, 17 Feb 2023 10:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=IiQvNV46PG861YdO43BFyOPyml3U42wY+SZjgR4qc0U=; b=dOgKFLbXupJL2W62ysa1uEEIIm02Gdn05hh4I59DOf/BFoYGn+sED4ENTskuAlsCqn l7Vtl2wzv/PUAicUUvssW28XQtOwHdkbMM/xBpcoSGfWOxEk1cqDCSEw+Qk7mOiydLE1 R/HdZ6UNlGJFIn+kBhorgctdd1LIbxjFkYYvVzRelw+jbdF/a7mWt3o27xnqZ0CAG0XQ foaI3Kn1ZTsBfBvYvaPfoBsOAN0V2017/kHETEWrdpLfA86mHUWjlJ8Xwl2Sy1L9rGID W6jQdTnW3KJwSkJwfIUGdA3bY9RUErRDTww+eT4GvxnJger8SIdomPSF4NkvXCrXbYMp w0RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IiQvNV46PG861YdO43BFyOPyml3U42wY+SZjgR4qc0U=; b=WLYRJYYhNCmClxZfD74htFVgonn5fP67gjqHF6cRsCsXOFXuigJZdei8Yq0gvADk63 dEWUltfFB+XzuPUmMpJ7xbWq6sGA2gF04Z7+lhAZImwMoGsRmLwcmlM2me5+ijb4k2LB OE67pLJhK2WZizIpkrAVY5RP0BGrC8ERi5BT/gpRm0j0wZq8Q5KhLw3mjjhDHa8smpzr Cverq3pEMqUyxIpr3Q0i+U6gY3871jqqvysinLRK0NeDpbhGAT3PjgxjWM82duYq0U5H EkcAU7uflkoXGKfYcmx/zd/rS8P0qoj+bOil5C9W2kHChQsH2UrKimutkMup+ZKM/CEr ZlkQ== X-Gm-Message-State: AO0yUKVovBASu4YGB9lK5gUH0BEsqm/i9YWyCx7K+mV3rSNAENpyvJ5N Ru6sc4TGlxglsbafHrfZJSc= X-Google-Smtp-Source: AK7set+DUbTEeN6Zxw23UGrTvX757MJvJmQ5kaAJmFDufrI0v7aBGYnnGKd1252RaDKVKww9/FYt/g== X-Received: by 2002:a05:600c:3b85:b0:3df:fcbd:3159 with SMTP id n5-20020a05600c3b8500b003dffcbd3159mr5410755wms.3.1676657213073; Fri, 17 Feb 2023 10:06:53 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id bd9-20020a05600c1f0900b003e1202744f2sm595193wmb.31.2023.02.17.10.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 10:06:52 -0800 (PST) Message-ID: <959a4528abf2fec979e3816ff8d175f65d13d1ab.camel@gmail.com> Subject: Re: Backward incompatible changes in mpd-service-type From: Liliana Marie Prikler To: Bruno Victal , Maxim Cournoyer Date: Fri, 17 Feb 2023 19:06:50 +0100 In-Reply-To: <8c7394ba-b8fa-eac5-7d3e-3d8160b71894@makinata.eu> References: <87y1owsbab.fsf@gmail.com> <8c7394ba-b8fa-eac5-7d3e-3d8160b71894@makinata.eu> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 User-Agent: Evolution 3.46.0 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61570 Cc: 61570@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) SGkgQnJ1bm8gYW5kIE1heGltLAoKQW0gRnJlaXRhZywgZGVtIDE3LjAyLjIwMjMgdW0gMTU6MzMg KzAwMDAgc2NocmllYiBCcnVubyBWaWN0YWw6Cj4gPiAyLsKgIFRoZSBNUEQgdXNlciBhcHBlYXJz IHRvIGJlIGNyZWF0ZWQgaW5zdGVhZCBvZiB1c2luZyBhbiBleGlzdGluZwo+ID4gb25lLsKgIEkg d2FzIHVzaW5nIG15IG93biBhY2NvdW50LCBsaWtlIHRoaXM6Cj4gPiAKPiA+IC0tODwtLS0tLS0t LS0tLS0tLS1jdXQgaGVyZS0tLS0tLS0tLS0tLS0tLXN0YXJ0LS0tLS0tLS0tLS0tLT44LS0tCj4g PiDCoMKgwqDCoMKgIChzZXJ2aWNlIG1wZC1zZXJ2aWNlLXR5cGUKPiA+IMKgwqDCoMKgwqDCoMKg wqDCoMKgwqDCoMKgwqAgKG1wZC1jb25maWd1cmF0aW9uCj4gPiDCoMKgwqDCoMKgwqDCoMKgwqDC oMKgwqDCoMKgwqAgKHVzZXIgIm1heGltIikKPiA+IMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg wqDCoCAoYWRkcmVzcyAiMC4wLjAuMCIpCj4gPiDCoMKgwqDCoM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feb 18 13:03:02 2023 Received: (at 61570) by debbugs.gnu.org; 18 Feb 2023 18:03:02 +0000 Received: from localhost ([127.0.0.1]:44916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTRY6-0005e1-Dx for submit@debbugs.gnu.org; Sat, 18 Feb 2023 13:03:02 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTRY4-0005dY-TF for 61570@debbugs.gnu.org; Sat, 18 Feb 2023 13:03:01 -0500 Received: by mail-wr1-f67.google.com with SMTP id bv9so777263wrb.3 for <61570@debbugs.gnu.org>; Sat, 18 Feb 2023 10:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:cc:to:subject:date:from:from:to:cc:subject :date:message-id:reply-to; bh=00gYDwnEjFTLnr4F1EcNAlSk51LjyHBA4pjYXlttGtc=; b=c5RtbcOF46BDpDrA+aDF+mvjC82YJfyTpRVfi0oZUuJ70coKtbnr9QHcpS2dfCW4q6 P5dVgue0cwiWJ/0dVwAOnSNIOGdQyKamIHWhQhyHS98SIjdNlG0oDUPI16KasiUPBRk4 ujFXXAqJn6VQPP1xzLlOd3FniYAy/oaLrQXvc8TfFEWPik/cigcDNQgkYHDhb5/KMq3/ Xf6ndwm+8TN62ih8VTaUp9H1am+XTwHh2XgcDPzi8BzsLHRtj/TV+l26adNLai7rBuJp nh5ArXDFB+Pl3MGMwbXC5qEAvXgLDwOHLr2hDGRCA1jBbzFT/umgZI0Ap5iH8yDyGNw9 WDCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:cc:to:subject:date:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=00gYDwnEjFTLnr4F1EcNAlSk51LjyHBA4pjYXlttGtc=; b=wpvc6sLuOz20VX0Ag6qIpryj/WC9HNpK9ocCMkKEjN16awYRTszq7/qic/mcj9nFmJ KH5bWvb9sCJwt4KChMssHeWQPwwN0zm7WMLAmC39wtxm71m2rFgkfNaGH34q9weWEt81 s+wl1/WIrQG9ON+ljWyE8T6Tg2/VLmLPL60PsRKHpDBvdFHsrTOLVV4QkgempEWLUOIl 3GFhhmRbk9SJjW+56uxeSpXpkyk6w4MkZ+BoCV31ooYXzMzZrO0SP9nL0U5+Z7HF12mY R3sg5FHluSEQCtC1TiNTcO1OLd3F2gqYdbsuD5kh78r8QRIUCEn/3p7bIFEeV5wwEjBw DjIQ== X-Gm-Message-State: AO0yUKUaTLOKlVuQ+oNYoEo7ZlcHXLCkklIDUVRJg+JYWVf984kks/4+ iW/2bXmOnrej1bRCYlw0Tec= X-Google-Smtp-Source: AK7set+6Zk21Tp5gT8jEUfK1kFbrO+ER3zRDLAK3qq43AuPGW4dcly4HOlts9wr6mtibsJwVr+/M3A== X-Received: by 2002:adf:e610:0:b0:2c5:48ed:d258 with SMTP id p16-20020adfe610000000b002c548edd258mr1683884wrm.35.1676743374909; Sat, 18 Feb 2023 10:02:54 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id r18-20020adfe692000000b002c5a790e959sm5574236wrm.19.2023.02.18.10.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 10:02:54 -0800 (PST) From: Liliana Marie Prikler Date: Sat, 18 Feb 2023 18:42:45 +0100 Subject: [PATCH] services: mpd: Use proper records. to: Maxim Cournoyer , Bruno Victal Message-ID: <08fff16dcb7b4e2da9f4e2e05d010b1ea339b776.camel@gmail.com> MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61570 Cc: 61570@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/audio.scm (mpd-user, mpd-group): New variables. (mpd-serialize-user-account, mpd-serialize-user-group): New variables. (mpd-configuration)[user]: Change type to user-account. Change default accordingly. [group]: Change type to user-group. Change default accordingly. (mpd-shepherd-service, mpd-accounts): Adjust accordingly. * doc/guix.texi ("Music Player Daemon") Adjust accordingly. --- This patch fixes the issue of not being able to insert actual users and groups into MPD service. Sadly, as define-configuration lacks proper support for sanitizers, it's a backwards-incompatible change. Perhaps it makes sense to extend define-configuration to support this case? Cheers doc/guix.texi | 4 ++-- gnu/services/audio.scm | 41 +++++++++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 44e2165a82..fa75eff62e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -33181,10 +33181,10 @@ Data type representing the configuration of @command{mpd}. @item @code{package} (default: @code{mpd}) (type: file-like) The MPD package. -@item @code{user} (default: @code{"mpd"}) (type: string) +@item @code{user} (default: @code{(mpd-user "mpd")}) (type: user-account) The user to run mpd as. -@item @code{group} (default: @code{"mpd"}) (type: string) +@item @code{group} (default: @code{(mpd-group "mpd")}) (type: user-group) The group to run mpd as. @item @code{shepherd-requirement} (default: @code{()}) (type: list-of-symbol) diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index d55b804ba9..df9b0ac7f1 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -62,6 +62,9 @@ (define-module (gnu services audio) mpd-partition-name mpd-partition-extra-options + mpd-user + mpd-group + mpd-configuration mpd-configuration? mpd-configuration-package @@ -328,6 +331,26 @@ (define list-of-mpd-plugin-or-output? (list-of (lambda (x) (or (mpd-output? x) (mpd-plugin? x))))) +(define* (mpd-user #:optional (name "mpd") (group "mpd")) + (user-account + (name name) + (group group) + (system? #t) + (comment "Music Player Daemon (MPD) user") + (home-directory "/var/lib/mpd") + (shell (file-append shadow "/sbin/nologin")))) + +(define* (mpd-group #:optional (name "mpd")) + (user-group + (name name) + (system? #t))) + +(define (mpd-serialize-user-account field value) + (mpd-serialize-string field (user-account-name value))) + +(define (mpd-serialize-user-group field value) + (mpd-serialize-string field (user-group-name value))) + (define-configuration mpd-configuration (package (file-like mpd) @@ -335,11 +358,11 @@ (define-configuration mpd-configuration empty-serializer) (user - (string "mpd") + (user-account (mpd-user "mpd")) "The user to run mpd as.") (group - (string "mpd") + (user-group (mpd-group "mpd")) "The group to run mpd as.") (shepherd-requirement @@ -512,7 +535,7 @@ (define (mpd-shepherd-service config) (and=> #$(maybe-value log-file) (compose mkdir-p dirname)) - (let ((user (getpw #$user))) + (let ((user (getpw #$(user-account-name user)))) (for-each (lambda (x) (when (and x (not (file-exists? x))) @@ -546,17 +569,7 @@ (define (mpd-shepherd-service config) (define (mpd-accounts config) (match-record config (user group) - (list (user-group - (name group) - (system? #t)) - (user-account - (name user) - (group group) - (system? #t) - (comment "Music Player Daemon (MPD) user") - ;; MPD can use $HOME (or $XDG_CONFIG_HOME) to place its data - (home-directory "/var/lib/mpd") - (shell (file-append shadow "/sbin/nologin")))))) + (list user group))) (define mpd-service-type (service-type base-commit: 312f1f41d3f3f3e5d2c36ff46920c6dce1c21a17 -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 19 08:54:54 2023 Received: (at 61570) by debbugs.gnu.org; 19 Feb 2023 13:54:54 +0000 Received: from localhost ([127.0.0.1]:45976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTk9W-0007JC-5Y for submit@debbugs.gnu.org; Sun, 19 Feb 2023 08:54:54 -0500 Received: from smtpm4.myservices.hosting ([185.26.105.235]:42734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTk9U-0007J4-ID for 61570@debbugs.gnu.org; Sun, 19 Feb 2023 08:54:52 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id B293820BCB; Sun, 19 Feb 2023 14:54:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 5637F8009E; Sun, 19 Feb 2023 14:54:46 +0100 (CET) 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 rvgd1U3qOcn2; Sun, 19 Feb 2023 14:54:46 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id D87918009D; Sun, 19 Feb 2023 14:54:45 +0100 (CET) Message-ID: <41356046-dc40-0f77-77d4-16a951cc0798@makinata.eu> Date: Sun, 19 Feb 2023 13:54:41 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH] services: mpd: Use proper records. Content-Language: en-US To: Liliana Marie Prikler , Maxim Cournoyer References: <08fff16dcb7b4e2da9f4e2e05d010b1ea339b776.camel@gmail.com> From: Bruno Victal In-Reply-To: <08fff16dcb7b4e2da9f4e2e05d010b1ea339b776.camel@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 61570 Cc: 61570@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hi Maxim, Liliana On 2023-02-18 17:42, Liliana Marie Prikler wrote:> This patch fixes the issue of not being able to insert actual users and > groups into MPD service. Sadly, as define-configuration lacks proper > support for sanitizers, it's a backwards-incompatible change. > Perhaps it makes sense to extend define-configuration to support this > case? I'd like to ask to hold merging this patch yet. I've got a few additional patches that addresses some usability issues and IMO we can get a nicer patch by fixing define-configuration directly (whilst preserving API compatibility). My intention is to patch define-configuration to accept a custom-sanitizer if specified. Cheers, Bruno From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 15:13:11 2023 Received: (at 61570) by debbugs.gnu.org; 25 Feb 2023 20:13:11 +0000 Received: from localhost ([127.0.0.1]:41622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pW0us-0003vX-SL for submit@debbugs.gnu.org; Sat, 25 Feb 2023 15:13:11 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:38624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pW0uq-0003vK-Uk for 61570@debbugs.gnu.org; Sat, 25 Feb 2023 15:13:09 -0500 Received: by mail-qv1-f47.google.com with SMTP id nf5so1871377qvb.5 for <61570@debbugs.gnu.org>; Sat, 25 Feb 2023 12:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=7Xy7J4LNRg1h5rWaHOQsauIsdqLvkgDPX2j4Cfa2txg=; b=jrl3+FDp+Sag+JdxX6SQ3cGXdkFHp12lqdJVD1GbxJjRdQq3bsONFnZJHcqE898aBq NC7spTexJIbxu5QyPGuAd0MrO2PA5IIv1inKHbgyvI78y+JzKiwHh2ldN8/XbZ9VkucY A9WZZ0JOlc3aJ4vI93MEb3DziDq91ZYrUIG9xUmBbuhZMrXYrlTApzWqCS5fF4yAwaV3 iKe4S9yfOvF0krPweQV2pE7DcLimzD7Uln0yJ46hWZsaKbOJLHVRnOo+NzNGzAN3pEad 833bh/0LtnUTCJRDVoiFb8+9nXZVDIV61WpVGnCRUPjL7Mymc+mEAWgAjQoTTxm3QQ1a wYcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7Xy7J4LNRg1h5rWaHOQsauIsdqLvkgDPX2j4Cfa2txg=; b=wg3a187b+WgkceZqKgYek01kpso/RMGkqHgsmF0YJN/w+Bk4EH98f4+h639YyRYXNx vJqd/TRuM6AuiI3M6dz+I8kPRW7cuI+6jnBmC07sL58PNVt6yPuaB0U/HHgLNnB5xxzK weUgTFzzZIblpIsEVy5nzO6fqwMkpizr6haYmPzVTet1t2UK0ui/hmDy4TEcEVIw88ML MFjKVjJRy+CrFV8Unpny5Q3ATWzeQpHOsqoLmPIW5DExJz5k5dSZHVNxCVbOmgciYAtq bMu1zmXg4hQscopUB+ZiUEoxq4s6CzEtKhAuUo7Jtqj+bg7UuBwRBkmszL/kRHcqz+uv sAzw== X-Gm-Message-State: AO0yUKU6ROwSFHiV1RLcd7oApQA1fIo5WVwFgZdoAQMvW2pds6em0Q4h VuLlL4xsgqeqbF51zA/5xLrxg7R0MxuLugca X-Google-Smtp-Source: AK7set8TtbBfu3RhhqmodUzNZQOEKlJTVLHKAl2A8jST6DDt5lqdW3Vy558Bkr7jNxh5XSYzYIxo/A== X-Received: by 2002:a05:6214:3017:b0:56e:bc57:d646 with SMTP id ke23-20020a056214301700b0056ebc57d646mr41527120qvb.43.1677355983189; Sat, 25 Feb 2023 12:13:03 -0800 (PST) Received: from hurd (dsl-141-27.b2b2c.ca. [66.158.141.27]) by smtp.gmail.com with ESMTPSA id p16-20020a05620a15f000b0071d0f1d01easm1729665qkm.57.2023.02.25.12.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 12:13:02 -0800 (PST) From: Maxim Cournoyer To: Bruno Victal Subject: Re: [PATCH] services: mpd: Use proper records. References: <08fff16dcb7b4e2da9f4e2e05d010b1ea339b776.camel@gmail.com> <41356046-dc40-0f77-77d4-16a951cc0798@makinata.eu> Date: Sat, 25 Feb 2023 15:13:01 -0500 In-Reply-To: <41356046-dc40-0f77-77d4-16a951cc0798@makinata.eu> (Bruno Victal's message of "Sun, 19 Feb 2023 13:54:41 +0000") Message-ID: <87o7phec6q.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61570 Cc: Liliana Marie Prikler , 61570@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Bruno Victal writes: > Hi Maxim, Liliana > > On 2023-02-18 17:42, Liliana Marie Prikler wrote:> This patch fixes the issue of not being able to insert actual users and >> groups into MPD service. Sadly, as define-configuration lacks proper >> support for sanitizers, it's a backwards-incompatible change. >> Perhaps it makes sense to extend define-configuration to support this >> case? > > I'd like to ask to hold merging this patch yet. I've got a few additional patches that addresses > some usability issues and IMO we can get a nicer patch by fixing define-configuration directly (whilst preserving API compatibility). > My intention is to patch define-configuration to accept a custom-sanitizer if specified. Sounds good! Thanks for working toward that. -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 06 20:13:43 2023 Received: (at 61570) by debbugs.gnu.org; 7 Mar 2023 01:13:43 +0000 Received: from localhost ([127.0.0.1]:44041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZLtf-0006fE-53 for submit@debbugs.gnu.org; Mon, 06 Mar 2023 20:13:43 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:36848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZLtd-0006f1-KI for 61570@debbugs.gnu.org; Mon, 06 Mar 2023 20:13:42 -0500 Received: by mail-qv1-f42.google.com with SMTP id m4so8005092qvq.3 for <61570@debbugs.gnu.org>; Mon, 06 Mar 2023 17:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678151616; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ssHUTgrq+deZfcBh4nXQ9hVnctXlHloWrPVZC9ROYSQ=; b=X64l/jf7OzGnjWwKQAGJzjOuF95j2i4NMAwleFfdosvdZdn77vLVpCCwwhvUf2hofZ 3DvHX2FRHa1uf7xv9tyzbroX3V+7PhCy2WE8I8pgCaczRjm63WkiVA8jNG0tvhiDttB+ 5ilF4qqMwL5DJtbB3p46mVGFK1VbBy11xoQv3aiyO8J0nAUh9k7tHX4riZmMfOkicnV3 NVTb9tTpS+NPmGtqXH4vEx2cv/hEwR3NKy6cg0lSe7rXoPcBItLzJbktOpPOBryvvVFb O1YyfyRnT7o9KkisFDdndR26yX8UVOj3X6SH+Y/G+WI7JyvoxGgFHHNjkXCRyEcjHUve ZOjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678151616; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ssHUTgrq+deZfcBh4nXQ9hVnctXlHloWrPVZC9ROYSQ=; b=ZHoHLt3r6tdNVzZhicRjAWABQpbsOufQgXfZgfs6IJIofhHfby7tyU7E041rhEzGv2 hgcz0GVX7IH+bXfofa+X9DzE2rSloErWjq+zF2mVUcBVPnoa/FFu2K6VZZJKQAwPN+A0 OvebidjFv6KEftcD3yfFAkjSYX7sAlU/p4ZyLzkZzxqcHx21RLu6zOlBNXDRcWKgn86Q LINAAE2uRYtu93D2nXkM/P/s3TEQb/wc4pTfrNjrEB9orZB9YzOkCCRqTAjbWWfdzBBw HSnxCe2Y/yAyUSz37p2FlkaM8wLd5IudKGOG7ctYPaSoKe69L+hrl7fFD2LnYfsIUppc JCrQ== X-Gm-Message-State: AO0yUKXLkJmGiv0YDl9qtOREcvyjVnIVcea3RSJJ2mzzkj6yX73rDZSi 6uKfMC7BukFxYHOd3aU5RCgU85OdwSSF1w== X-Google-Smtp-Source: AK7set92MW/6oQmqSIpJfxRj+OFMTy85gF7YEHxQvPm+5xsUfQgEWDcCuT6tgFSOimkf8xUtJhJmlg== X-Received: by 2002:a05:6214:da4:b0:535:5492:b427 with SMTP id h4-20020a0562140da400b005355492b427mr23750394qvh.28.1678151615920; Mon, 06 Mar 2023 17:13:35 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id b24-20020a05620a0f9800b007419f1561fesm8341985qkn.112.2023.03.06.17.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 17:13:35 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: Backward incompatible changes in mpd-service-type References: <87y1owsbab.fsf@gmail.com> <8c7394ba-b8fa-eac5-7d3e-3d8160b71894@makinata.eu> <959a4528abf2fec979e3816ff8d175f65d13d1ab.camel@gmail.com> Date: Mon, 06 Mar 2023 20:13:34 -0500 In-Reply-To: <959a4528abf2fec979e3816ff8d175f65d13d1ab.camel@gmail.com> (Liliana Marie Prikler's message of "Fri, 17 Feb 2023 19:06:50 +0100") Message-ID: <87bkl5z7lt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61570 Cc: Bruno Victal , 61570@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Liliana, Liliana Marie Prikler writes: [...] >> This is an unfortunate situation arising from a bug before the >> service was refactored. >> Before d7fd9ec209f72e9cfff04a48bf16e092f258d8ff (actually >> 5c5f0fc1135ff15f9c4adfc5f27eadd9a592b5d1) >> mpd-service-type contained a service-extension for %mpd-accounts >> where the values for both group and user were hardcoded to "mpd" >> but this was actually never used since shepherd would launch the >> service using root and mpd would downgrade its permissions and switch >> to the user specified in the mpd-configuration record since this >> field is serialized to the configuration file. > It would be quite weird if someone had already pointed out how to > properly handle the accounts and groups only for that to be ignored > later in the review. > > Am Samstag, dem 24.12.2022 um 18:20 +0100 schrieb eine leichtsinnige > Person, die ihre eigenen Anmerkungen vergisst: >> I think you should make it so that you can pass a user-account and >> user-group to the mpd service so that they can be reused (with a >> sanitizer that creates a user/group from string). > Never mind then. I think Bruno has been reworking that, I think they must be about ready. > Am Freitag, dem 17.02.2023 um 07:53 -0500 schrieb Maxim Cournoyer: >> Else an error rather than a warning when multiple same-name users are >> defined would be more appropriate, I think. > Guess what, it used to be a formatted message (i.e. an actual error). > However, that broke some configs as reported in [1], so I demoted it to > a warning. Interesting. I didn't know we were usefully (?) abusing duplicate users and group. Perhaps we should try to isolate the most common offenders (services?), fix them up, and then re-introduce the check, perhaps gradually (e.g. "in 6 months time, duplicated users or groups will become a configuration error"). -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 00:31:53 2023 Received: (at 61570) by debbugs.gnu.org; 7 Mar 2023 05:31:53 +0000 Received: from localhost ([127.0.0.1]:44281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZPvU-00052G-UB for submit@debbugs.gnu.org; Tue, 07 Mar 2023 00:31:53 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:44868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZPvT-000524-41 for 61570@debbugs.gnu.org; Tue, 07 Mar 2023 00:31:51 -0500 Received: by mail-ed1-f68.google.com with SMTP id ay14so44092642edb.11 for <61570@debbugs.gnu.org>; Mon, 06 Mar 2023 21:31:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678167105; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=aFSwizBEEMaPhQOY5D35YFx2qaiKPo9AShP3Dgoyllo=; b=aobQtsfzYU5yf4FBHFBXya7sJRG+YnRrZUzED8M1aqgZirI/6Xsow76QJqwhS5x3zb 4opuOE+x524q/BztbNmnJwZj44FjELsWiWp7N/WUp50qQETs+0qvF/wcUtU4E7X6hZKv GnoVjZU9SYRPIFG83IfoxJYCUq2enge/UZggPRHCB/E7vpbGwZDUTdI/g7QDf97HAGeL DXTebCW/ysmp/qJpNjqUeOmeloDAVQFoZc1DsZ4apNm/oy2Zxyqg2UYL7viTzq3eQc/2 ApfiNBjUrn63Iwc0T8HGv1NHnLFtnJQv9MgKauVa4efBGIUaeVF76i3sBXf3bLYJc1w2 hHqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678167105; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aFSwizBEEMaPhQOY5D35YFx2qaiKPo9AShP3Dgoyllo=; b=RqxTE6peiwSyjRuNJmQNfWD55+SQIhnEgLXoBz0EAGcNneC1bDNBkycWeioIq6zrXb KsBJiu+1Fbs7moPkERSgUn7Hyv901/z5qiodKGPKPQNQj5KVapCbudnYsK9/1rx8j8p9 o9mmZGN3MjUTFCcojnZTe5/BpYUYn7RRHvTP0isJFHjJAgQltF60GyDoQPLGTRNY/4Qb yk4wrrzK7nQYsvYBzuo9VnIxBCGDaGIlaOKZgUPa/fvkBzOFhEYOnrAIMsOYX5kl/yvZ xIST6nEzpw5YQjcgNfcOO8bT7kOHTlxSU+pst+Forxj7J/9uqj8a/dV2Rz4EeL9amKJ/ KKzg== X-Gm-Message-State: AO0yUKV/So3qHCP7gX3SuSt6OAmfukhpIqTx0oIxxDMMrrMXIDdO0bA1 BOjjNKVWWD6ProXz2BvN1+8= X-Google-Smtp-Source: AK7set9wOWVi/llo3vNbm56/rdKxiepxxFKfFM3VQW3Lit96427utJjRbSR+UI9KvGGHJJ8EmKJsOg== X-Received: by 2002:a05:6402:2028:b0:4af:70a5:55ee with SMTP id ay8-20020a056402202800b004af70a555eemr11277728edb.3.1678167104858; Mon, 06 Mar 2023 21:31:44 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id z19-20020a50cd13000000b004bd1fe2cc02sm5985146edi.16.2023.03.06.21.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 21:31:44 -0800 (PST) Message-ID: Subject: Re: Backward incompatible changes in mpd-service-type From: Liliana Marie Prikler To: Maxim Cournoyer Date: Tue, 07 Mar 2023 06:31:43 +0100 In-Reply-To: <87bkl5z7lt.fsf@gmail.com> References: <87y1owsbab.fsf@gmail.com> <8c7394ba-b8fa-eac5-7d3e-3d8160b71894@makinata.eu> <959a4528abf2fec979e3816ff8d175f65d13d1ab.camel@gmail.com> <87bkl5z7lt.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61570 Cc: Bruno Victal , 61570@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Am Montag, dem 06.03.2023 um 20:13 -0500 schrieb Maxim Cournoyer: > > Am Freitag, dem 17.02.2023 um 07:53 -0500 schrieb Maxim Cournoyer: > > > Else an error rather than a warning when multiple same-name users > > > are defined would be more appropriate, I think. > > Guess what, it used to be a formatted message (i.e. an actual > > error). However, that broke some configs as reported in [1], so I > > demoted it to a warning. >=20 > Interesting.=C2=A0 I didn't know we were usefully (?) abusing duplicate > users and group. As far as I'm aware, we aren't. Even if such uses exist, they raise said warning and probably cause more issues down the line, like with your bug report. > Perhaps we should try to isolate the most common offenders > (services?), fix them up, and then re-introduce the check, perhaps > gradually (e.g. "in 6 months time, duplicated users or groups will > become a configuration error"). The only instance known to me (cups creating a duplicate lp group) was fixed back in 2021. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 10:42:28 2023 Received: (at 61570-done) by debbugs.gnu.org; 2 Apr 2023 14:42:28 +0000 Received: from localhost ([127.0.0.1]:42448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piyua-000616-0d for submit@debbugs.gnu.org; Sun, 02 Apr 2023 10:42:28 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:48308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piyuZ-00060y-0g for 61570-done@debbugs.gnu.org; Sun, 02 Apr 2023 10:42:27 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id E3D0F2043B for <61570-done@debbugs.gnu.org>; Sun, 2 Apr 2023 16:42:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 98CC7800A0 for <61570-done@debbugs.gnu.org>; Sun, 2 Apr 2023 16:42:25 +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 DK0R49Dz1Al2 for <61570-done@debbugs.gnu.org>; Sun, 2 Apr 2023 16:42:25 +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 528308009E for <61570-done@debbugs.gnu.org>; Sun, 2 Apr 2023 16:42:25 +0200 (CEST) Message-ID: Date: Sun, 2 Apr 2023 15:42:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US To: 61570-done@debbugs.gnu.org From: Bruno Victal Subject: control-msg Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61570-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Done with 7fdadeac11a997583305cb867b4a8828808ae953. From unknown Sat Aug 16 16:14:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 01 May 2023 11:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator