[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63082: [PATCH v3 07/16] services: mpd; Refactor start slot directory
From: |
Bruno Victal |
Subject: |
bug#63082: [PATCH v3 07/16] services: mpd; Refactor start slot directory initialization. |
Date: |
Wed, 24 May 2023 17:26:43 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 |
On 2023-05-05 19:29, Maxim Cournoyer wrote:
> - (make-forkexec-constructor
> - (list #$(file-append package "/bin/mpd")
> - "--no-daemon"
> - #$config-file)
> - #:environment-variables '#$environment-variables)))
> + (start
> + (with-imported-modules (source-module-closure
> + '((gnu build activation)))
How about adding '(gnu build activation) into %default-imported-modules
(and %default-modules) at gnu/services/shepherd.scm?
Services should be using the start field to perform these kinds of tasks
anyways. (rather than extend activation-service-type which is incorrect use)
> + #~(begin
> + (use-modules (gnu build activation))
In general, rather than #~(begin (use-modules ...)), it's preferred to specify
additional modules using the 'modules' field e.g.
--8<---------------cut here---------------start------------->8---
(modules (cons '(gnu build activation)
%default-modules))
--8<---------------cut here---------------end--------------->8---
> +
> + (let ((user (getpw #$username)))
> +
> + (define (init-directory directory)
> + (unless (file-exists? directory)
> + (mkdir-p/perms directory user #o755)))
> +
> + (for-each
> + init-directory
> + '#$(map dirname
> + ;; XXX: Delete the potential "syslog"
> + ;; log-file value, which is not a directory.
> + (delete "syslog"
> + (filter-map maybe-value
> + (list db-file
> + log-file
> + state-file
> + sticker-file))))))
Perhaps treat “syslog” as a symbol instead?
Strings seem more adequate when the value is a path, with a symbol
being a sign that the value is to be treated “specially”.
(this aligns with how mympd handles this)
--
Furthermore, I consider that nonfree software must be eradicated.
Cheers,
Bruno.
- bug#63082: [PATCH v3 02/16] services: mpd: Add an 'update' action to trigger a database update., (continued)
- bug#63082: [PATCH v3 02/16] services: mpd: Add an 'update' action to trigger a database update., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 11/16] system: accounts: Export <user-account>., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 13/16] services: mpd: Auto-detect mpd-output mixer type by default., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 04/16] services: mpd: Rename %set-user-group to set-user-group., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 03/16] services: mpd: Streamline mpd-user-sanitizer and mympd-user-sanitizer., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 07/16] services: mpd; Refactor start slot directory initialization., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 07/16] services: mpd; Refactor start slot directory initialization.,
Bruno Victal <=
- bug#63082: [PATCH v3 10/16] services: mpd: Let Shepherd effect the user/group change., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 09/16] services: mpd: Do not rotate logs when using syslog., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 14/16] services: mpd: Provision a default cache directory and set HOME., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 16/16] services: Avoid 'delete' overrides warning in audio module., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 15/16] services: mpd: Update basic example., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 06/16] services: mpd: List log-level in decreasing verbosity order in doc., Maxim Cournoyer, 2023/05/05
- bug#63082: [PATCH v3 05/16] services: mpd: Obsolete the 'group' field., Maxim Cournoyer, 2023/05/05