unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Bruno Victal <mirai@makinata.eu>
Cc: maxim.cournoyer@gmail.com, 60788@debbugs.gnu.org
Subject: [bug#60788] [PATCH] services: Add vnstat-service-type.
Date: Thu, 20 Apr 2023 12:09:54 +0200	[thread overview]
Message-ID: <877cu6x3t9.fsf@gnu.org> (raw)
In-Reply-To: <07feadac-18b2-7e82-9798-3e3872efcd4a@makinata.eu> (Bruno Victal's message of "Sat, 8 Apr 2023 13:40:39 +0100")

Hello!

Bruno Victal <mirai@makinata.eu> skribis:

>>> +@item @code{database-dir} (default: @code{"/var/lib/vnstat"}) (type: string)
>> 
>> [...]
>> 
>>> +@item @code{create-dirs?} (default: @code{#t}) (type: maybe-boolean)
>> 
>> For consistency, both within this record and with the rest of Guix, I
>> suggest avoiding abbreviations.  Since this will be part of the API,
>> better fix it now than later.
>
> I should mention that almost all of the field names here are near verbatim
> vnstat config-file directives, i.e. a near 1-1 Scheme translation of vnstat config.
> This has the benefit that it makes serialization pretty much straightforward.
>
> It's possible to override their names by the use of the custom serializer parameter
> but would it be acceptable to leave them as-is?

Hmm, I’d say that if the cost of using “nice names” is “really high”,
then yes.  But perhaps we can make that cost low by having a map for the
few cases where we use a name different from upstream?

  (define field-name-mapping
    '((database-directory . "database_dir") …))

> (define-module (gnu tests vnstat)

Woohoo, you rock!

>             (test-assert "vnstatd is logging"
>               ;; pump garbage into the "discard" service within the vm
>               ;; TODO: guile socket client instead? Is it feasible?
>               (let* ((socat #$(file-append socat "/bin/socat"))
>                      (dest-addr #$(format #f "TCP4:localhost:~d"
>                                           forwarded-port))
>                      (args `("socat" "-u" "/dev/zero" ,dest-addr))
>                      ;; XXX: Guile bug (22/03/2023, Guile 3.0.9)
>                      ;;      Fixed in main: <https://issues.guix.gnu.org/61073>
>                      #;(output-port (%make-void-port "w"))
>                      (garbage-pump-pid (spawn socat args)))

You can probably connect directly to DEST-ADDR from Guile instead of
going through ‘socat’?

If not, you can either pass ‘#:guile guile-3.0-latest’ to
‘gexp->derivation’ so you get ‘spawn’ (3.0.9 is the default in
‘core-updates’ anyway), or use ‘primitive-fork’.

HTH!

Ludo’.




  reply	other threads:[~2023-04-20 10:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 20:07 [bug#60788] [PATCH] services: Add vnstat-service-type Bruno Victal
2023-01-14 21:06 ` [bug#60788] [PATCH v2] " Bruno Victal
2023-01-16 18:42 ` [bug#60788] [PATCH] " Maxim Cournoyer
2023-01-16 19:31   ` Bruno Victal
2023-01-16 19:56     ` Maxim Cournoyer
2023-01-18  0:34 ` [bug#60788] [PATCH v2] " Bruno Victal
2023-01-18  0:37 ` [bug#60788] [PATCH v2] services: vnstat: Use least-authority-wrapper Bruno Victal
2023-02-02 14:21 ` [bug#60788] [PATCH v3] services: Add vnstat-service-type Bruno Victal
2023-02-07 14:25 ` [bug#60788] [PATCH v4] " Bruno Victal
2023-02-09  3:34   ` [bug#60788] [PATCH] " Maxim Cournoyer
2023-02-09  4:19     ` Bruno Victal
2023-02-09 13:31       ` Maxim Cournoyer
2023-02-10 13:15 ` [bug#60788] [PATCH v5] " Bruno Victal
2023-02-10 14:07   ` Maxim Cournoyer
2023-02-10 14:14 ` [bug#60788] [PATCH v6] " Bruno Victal
2023-03-22 16:15 ` [bug#60788] [PATCH v7] " Bruno Victal
2023-04-03 14:14 ` [bug#60788] [PATCH v8] " Bruno Victal
2023-04-04 13:08 ` [bug#60788] [PATCH v9] " Bruno Victal
2023-04-07 15:22   ` [bug#60788] [PATCH] " Ludovic Courtès
2023-04-07 20:04     ` Maxim Cournoyer
2023-04-20 10:03       ` [bug#60788] Policy for system tests? Ludovic Courtès
2023-04-08 12:40     ` [bug#60788] [PATCH] services: Add vnstat-service-type Bruno Victal
2023-04-20 10:09       ` Ludovic Courtès [this message]
2023-05-05  0:18 ` [bug#60788] [PATCH v10 1/3] " Bruno Victal
2023-05-11 14:33   ` bug#60788: " Ludovic Courtès
2023-05-05  0:18 ` [bug#60788] [PATCH v10 2/3] services: inetd: Export accessors Bruno Victal
2023-05-05  0:18 ` [bug#60788] [PATCH v10 3/3] tests: Add vnstat tests 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

  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=877cu6x3t9.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=60788@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=mirai@makinata.eu \
    /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).