From: Mathieu Othacehe <othacehe@gnu.org>
To: Jean-Baptiste Note <jean-baptiste.note@m4x.org>
Cc: 41180@debbugs.gnu.org
Subject: [bug#41180] [PATCH] Add cachefilesd service.
Date: Tue, 19 May 2020 14:12:03 +0200 [thread overview]
Message-ID: <87k118unsc.fsf@gnu.org> (raw)
In-Reply-To: <87v9l3zjg7.fsf@m4x.org> (Jean-Baptiste Note's message of "Sun, 10 May 2020 19:19:36 +0000")
Hello,
Overall, this looks nice! A few comments below. Note that you can merge
this patch with the documentation patch. It would also be nice to add
the associated system tests.
> +(define-record-type* <cachefilesd-configuration>
> + cachefilesd-configuration make-cachefilesd-configuration
> + cachefilesd-configuration?
> +
> + ;; <package-path>
> + (cachefilesd cachefilesd-configuration-cachefilesd
> + (default cachefilesd))
> +
You could write something more concise here by removing empty lines and
adding the 'type' comment on the same line.
> + (let ((secctx #$(cachefilesd-configuration-secctx config)))
> + (if secctx (format port "secctx ~a" secctx)))
You can use 'when' for one arm if conditions.
> +
> + ;; XXX factor this
> + (format port "brun ~a%\n"
> + #$(number->string
> + (cachefilesd-configuration-brun config)))
It would indeed be nice to factor it, maybe by creating an association
table with the symbol name as CAR and the matching procedure as
CDR. Something like:
--8<---------------cut here---------------start------------->8---
'(("frun" . cachefilesd-configuration-frun)
("bcull" . cachefilesd-configuration-bcull))
--8<---------------cut here---------------end--------------->8---
then you could iterate on that list.
> + (if #$(cachefilesd-configuration-nocull? config)
> + (display "nocull\n" port))
Same as above. You can use 'when' or 'unless' instead of "(if test
stmt)".
> + ;; Make sure the cache directory and pid dir exists
"dir" -> "directory".
> + ;; XXX shepherd pid file handling: no idea how shepherd does it
> + ;; and if it's going to conflict with cachefilesd's
Shepherd documentation says:
--8<---------------cut here---------------start------------->8---
When PID-FILE is true, it must be the name of a PID file associated
with the process being launched; the return value is the PID once
that file has been created. If PID-FILE does not show up in less
than PID-FILE-TIMEOUT seconds, the service is considered as failing
to start.
--8<---------------cut here---------------end--------------->8---
So I think you can remove this comment.
Thanks,
Mathieu
next prev parent reply other threads:[~2020-05-19 12:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-10 19:19 [bug#41180] [PATCH] Add cachefilesd service Jean-Baptiste Note
2020-05-10 19:27 ` Jean-Baptiste Note
2020-05-11 15:06 ` Mathieu Othacehe
2020-05-19 12:12 ` Mathieu Othacehe [this message]
2020-05-20 20:39 ` Jean-Baptiste Note
2020-05-23 6:44 ` Mathieu Othacehe
2020-09-02 14:58 ` Mathieu Othacehe
2023-03-09 12:24 ` [bug#41180] [PATCH v2] gnu: services: Add cachefilesd service. (Closes: #41180) Felix Lechner via Guix-patches via
2023-04-30 4:10 ` bug#41180: Closing in favor of Bug#63182 Felix Lechner via Guix-patches via
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k118unsc.fsf@gnu.org \
--to=othacehe@gnu.org \
--cc=41180@debbugs.gnu.org \
--cc=jean-baptiste.note@m4x.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).