all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: mirai <mirai@makinata.eu>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>, 59866@debbugs.gnu.org
Subject: [bug#59866] [PATCH v5.1] services: mpd: Refactor MPD service.
Date: Sat, 24 Dec 2022 19:17:29 +0000	[thread overview]
Message-ID: <9d585ea3-2cab-6aee-16ee-672e4cf1cf81@makinata.eu> (raw)
In-Reply-To: <4a93981e06259ffac47ecc6f988c37d1910593ee.camel@gmail.com>

On 2022-12-24 17:20, Liliana Marie Prikler wrote:
>> -(define %mpd-accounts
>> -  ;; Default account and group for MPD.
>> -  (list (user-group (name "mpd") (system? #t))
>> -        (user-account
>> -         (name "mpd")
>> -         (group "mpd")
>> -         (system? #t)
>> -         (comment "Music Player Daemon (MPD) user")
>>  
>> -         ;; Note: /var/run/mpd hosts one sub-directory per user, of
>> which
>> -         ;; /var/run/mpd/mpd corresponds to the "mpd" user.
>> -         (home-directory "/var/run/mpd/mpd")
>> +        ;; TODO: remove me, migrates from the old location at
>> /var/run/mpd
>> +        ;;       to the new one at /var/lib/mpd.
>> +        (let* ((user (getpw #$user))
>> +               (deprecated-directory (string-append "/var/run/mpd/"
>> +                                                    #$user "/.mpd"))
>> +               (new-directory (string-append (passwd:dir user)
>> +                                             "/.config/mpd")))
>> +          (when (and (file-exists? deprecated-directory)
>> +                     (not (file-exists? new-directory)))
>> +            (rename-file deprecated-directory new-directory)
>> +            (chown new-directory (passwd:uid user) (passwd:gid
>> user))))
>> +        (mkdir-p (dirname #$log-file)))))
> I'm not sure whether we should migrate the logs here.  I do think the
> logs should be stored in /var/log rather than /var/run, but other than
> that I'm not even sure there's much value in changing the /var/run/mpd
> structure.  What's your use case for doing so?

I agree with you that they belong to /var/log, though I prefer leaving this to
MPDs default behavior when the directives are not explicitly set.
IIRC MPD will store them under $XDG_CONFIG_HOME/log if the "log_file" directive
is absent.

They were previously stored under /var/run because it was set by default to store
under ~/.mpd and the user account had its $HOME set as "/var/run/mpd/mpd".
(Looking closer to the old behavior, this also meant that the user field was actually
ignored as the user-group/user-account was hardcoded).
Since /var/run/mpd(/mpd) is the $HOME directory in the old style configuration, it
also contains other files of interest, as most of the fields default values are
directives relative to $HOME.

Personally I've no use to this migration part and I'd prefer an outright breaking
change to the new style, most of the MPD generated files can be regenerated without much hardship
and this is introducing complexity and soon™ to be obsolete code.

Cheers




  reply	other threads:[~2022-12-24 19:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 23:22 [bug#59866] [PATCH 0/2] services: mpd: Refactor MPD service mirai
2022-12-06 23:25 ` [bug#59866] [PATCH 1/2] services: mpd: use 'define-configuration' mirai
2022-12-06 23:25 ` [bug#59866] [PATCH 2/2] services: mpd: Refactor MPD service mirai
2022-12-07  8:59 ` [bug#59866] [PATCH 0/2] " ( via Guix-patches via
2022-12-07 13:42   ` mirai
2022-12-07 13:43     ` ( via Guix-patches via
2022-12-07 18:27 ` Liliana Marie Prikler
2022-12-08 13:11   ` mirai
2022-12-08 13:35     ` [bug#54986] " Liliana Marie Prikler
2022-12-09 13:44       ` [bug#59866] " mirai
2022-12-09 19:22         ` Liliana Marie Prikler
2022-12-11 12:05           ` mirai
2022-12-08  0:59 ` [bug#59866] [PATCH v2] " mirai
2022-12-16 14:15 ` [bug#59866] [PATCH v3] " mirai
2022-12-21 14:15 ` [bug#59866] [PATCH v4 1/2] services: mpd: use 'define-configuration' mirai
2022-12-21 14:15   ` [bug#59866] [PATCH v4 2/2] services: mpd: Refactor MPD service mirai
2022-12-24 13:51 ` [bug#59866] [PATCH v5 1/2] services: mpd: rewrite using 'define-configuration' mirai
2022-12-24 13:51   ` [bug#59866] [PATCH v5 2/2] services: mpd: Refactor MPD service mirai
2022-12-24 14:11 ` [bug#59866] [PATCH v5.1] " mirai
2022-12-24 17:20   ` Liliana Marie Prikler
2022-12-24 19:17     ` mirai [this message]
2022-12-24 18:53 ` [bug#59866] [PATCH v5.2] " mirai
2023-01-03 14:43 ` [bug#59866] Pulseaudio woes mirai
2023-01-03 19:38   ` Liliana Marie Prikler
2023-02-02 20:07 ` [bug#59866] [PATCH v6 1/3] services: mpd: Rewrite using 'define-configuration' Bruno Victal
2023-02-02 20:07   ` [bug#59866] [PATCH v6 2/3] services: mpd: Refactor MPD service Bruno Victal
2023-02-02 21:08     ` Liliana Marie Prikler
2023-02-05  6:11       ` bug#59866: " Liliana Marie Prikler
2023-02-02 20:07   ` [bug#59866] [PATCH v6 3/3] services: mpd: Do not hardcode environment variables Bruno Victal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d585ea3-2cab-6aee-16ee-672e4cf1cf81@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=59866@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.