[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63082: [PATCH 07/17] services: mpd: Log to syslog by default.
From: |
Bruno Victal |
Subject: |
bug#63082: [PATCH 07/17] services: mpd: Log to syslog by default. |
Date: |
Fri, 28 Apr 2023 23:02:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 |
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.
bug#63082: [PATCH 07/17] services: mpd: Log to syslog by default., Maxim Cournoyer, 2023/04/28
bug#63082: [PATCH 17/17] services: Avoid 'delete' overrides warning in audio module., Maxim Cournoyer, 2023/04/28
bug#63082: [PATCH v2 00/16] Improve out-of-the-box experience with mpd-service-type, Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 03/16] services: mpd: Rename %set-user-group to set-user-group., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 01/16] services: mpd: Add an 'update' action to trigger a database update., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 06/16] services: mpd; Refactor start slot directory initialization., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 02/16] services: mpd: Streamline mpd-user-sanitizer and mympd-user-sanitizer., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 04/16] services: mpd: Obsolete the 'group' field., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 05/16] services: mpd: List log-level in decreasing verbosity order in doc., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 11/16] services: mpd: Warn when the MPD user is not in the "audio" group., Maxim Cournoyer, 2023/04/29