From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OId5OsYPQWS/PAAASxT56A (envelope-from ) for ; Thu, 20 Apr 2023 12:11:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ZcdzOsYPQWRRhAEAauVa8A (envelope-from ) for ; Thu, 20 Apr 2023 12:11:18 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CA44C39EC9 for ; Thu, 20 Apr 2023 12:11:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppRFx-0008D9-Vx; Thu, 20 Apr 2023 06:11:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppRFn-0008Ap-7b for guix-patches@gnu.org; Thu, 20 Apr 2023 06:11:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppRFm-0007hW-Af for guix-patches@gnu.org; Thu, 20 Apr 2023 06:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ppRFl-00057p-Ro for guix-patches@gnu.org; Thu, 20 Apr 2023 06:11:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#60788] [PATCH] services: Add vnstat-service-type. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Apr 2023 10:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Bruno Victal Cc: maxim.cournoyer@gmail.com, 60788@debbugs.gnu.org Received: via spool by 60788-submit@debbugs.gnu.org id=B60788.168198540719616 (code B ref 60788); Thu, 20 Apr 2023 10:11:01 +0000 Received: (at 60788) by debbugs.gnu.org; 20 Apr 2023 10:10:07 +0000 Received: from localhost ([127.0.0.1]:36650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppREs-00056K-I5 for submit@debbugs.gnu.org; Thu, 20 Apr 2023 06:10:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppREo-00055g-T3 for 60788@debbugs.gnu.org; Thu, 20 Apr 2023 06:10:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppREj-0007Gs-2D; Thu, 20 Apr 2023 06:09:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=cuSvwD/D5FkAxwFb0Uk+NQlcZcD6KxUAlA4GF5YUlEc=; b=kdojRE1A3PQ7uwhAhXl0 iqLsCB8Fe+1HnsNARrbRavgeuXz6v3NQNa7Dzhl4HL+Yx53YP8pXEa/8ctFmqOeNtQ/1BEd3d/V05 D6TgAaalw8R0ITQV7Zmh7gQozYV7UIFFrvFUHA3nMt4nwiCdwAGM6SaZ/OTEeMRxev0loM0vtA8Fz If8+N8kcYN/XrAuwKFkhbJn67gDLzMperv2HpIeps4QPo4EMlFubj8UIYBbx75tEJv6JBtYF/rQ+y buiXcN1pSq3PkkEMW+iJH+G6TtP9UC/NLCKvRGVwpMK1iB0Uwnz2wwANZJMxcycCMoH+XBlYH8DnM NqI/CbawiODVQg==; Received: from [193.50.110.118] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppREi-0003IK-MI; Thu, 20 Apr 2023 06:09:56 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <95b646eb6b23dec213cba43b6e4e7ddc4a601d0f.1673640404.git.mirai@makinata.eu> <87edovd8em.fsf_-_@gnu.org> <07feadac-18b2-7e82-9798-3e3872efcd4a@makinata.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Primidi 1 =?UTF-8?Q?Flor=C3=A9al?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Rose X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 20 Apr 2023 12:09:54 +0200 In-Reply-To: <07feadac-18b2-7e82-9798-3e3872efcd4a@makinata.eu> (Bruno Victal's message of "Sat, 8 Apr 2023 13:40:39 +0100") Message-ID: <877cu6x3t9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=kdojRE1A; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681985478; a=rsa-sha256; cv=none; b=BONzXsdKDBIs+wm98AmHUkGG075VZSVTl1N1Qg5L6yX/eExVkKB6I8fHu3/Hs3LiMKuvCu 62WOFPDSNs+CTjMXpn0fqn/H2sD69bzIwntLIHvRHyR8LKvqEX/WKaYeHfi1IWVzzJGbfw hnpBD56XoECbBLVxNIc38tBuGE4PlxTwBXOJVKO8hnzfBSpxjCA+fi7aLZEabszzYMTY7m oBXK7Q2sZ9j64wUS9IUgoD1NQivt4sFwHY6LvAuzaBmhAn+PAmvWReUDqVhY5s11ar6dvZ OrVAKNg+m0CgU8/ZJdcdtBxhRL5uH7cLanzmTJ0iSuDVCsbEZgq4or9s53R2aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681985478; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cuSvwD/D5FkAxwFb0Uk+NQlcZcD6KxUAlA4GF5YUlEc=; b=G2bGI47miwtmdy12PSRSb1NQY5C/hLsajOz3IlhGAUHgWPG8IvgMchzl3MXVGuXWRuFhgF MLijrxkAL6wnyus+7tN2SzdZEBGp9bEFhaymfB6ZTUKKMB+vr1+3CYlVSXA53abN1E2fLz Kjb7eeysduYBRQuKdUYyHOBF/CrXi8KuR05SmVsn4t2VdJiAjFn+uB7iMjqcphdLw3Vp2u RZEQm+awjpse0LDT1I0dSejn1EgdfwBqZR+KZYESp7Jqw0mHvXT36+0SRHHmKHhEuhzp4i zFRkk8AnAmhM/VBbMM0/yEkLxpG6Ofc0UlQBPLkNntuy/Yaor5+sn8T1F4x+pQ== X-Migadu-Spam-Score: -3.21 X-Spam-Score: -3.21 X-Migadu-Queue-Id: CA44C39EC9 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=kdojRE1A; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: t6S/UL3ono3w Hello! Bruno Victal skribis: >>> +@item @code{database-dir} (default: @code{"/var/lib/vnstat"}) (type: s= tring) >>=20 >> [...] >>=20 >>> +@item @code{create-dirs?} (default: @code{#t}) (type: maybe-boolean) >>=20 >> 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 vnst= at config. > This has the benefit that it makes serialization pretty much straightforw= ard. > > 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=E2=80=99d say that if the cost of using =E2=80=9Cnice names=E2=80=9D= is =E2=80=9Creally high=E2=80=9D, 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") =E2=80=A6)) > (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: > #;(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 =E2=80=98socat=E2=80=99? If not, you can either pass =E2=80=98#:guile guile-3.0-latest=E2=80=99 to =E2=80=98gexp->derivation=E2=80=99 so you get =E2=80=98spawn=E2=80=99 (3.0.= 9 is the default in =E2=80=98core-updates=E2=80=99 anyway), or use =E2=80=98primitive-fork=E2= =80=99. HTH! Ludo=E2=80=99.