From unknown Tue Sep 09 02:38:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#30003 <30003@debbugs.gnu.org> To: bug#30003 <30003@debbugs.gnu.org> Subject: Status: [PATCH 2/2] gnu: services: Add darkstat service. Reply-To: bug#30003 <30003@debbugs.gnu.org> Date: Tue, 09 Sep 2025 09:38:30 +0000 retitle 30003 [PATCH 2/2] gnu: services: Add darkstat service. reassign 30003 guix-patches submitter 30003 =E5=AE=8B=E6=96=87=E6=AD=A6 severity 30003 normal tag 30003 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 06 03:45:49 2018 Received: (at submit) by debbugs.gnu.org; 6 Jan 2018 08:45:49 +0000 Received: from localhost ([127.0.0.1]:37544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXk6v-00011w-1N for submit@debbugs.gnu.org; Sat, 06 Jan 2018 03:45:49 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXk6r-00011V-8Q for submit@debbugs.gnu.org; Sat, 06 Jan 2018 03:45:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXk6k-0002Vc-Nv for submit@debbugs.gnu.org; Sat, 06 Jan 2018 03:45:40 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXk6k-0002VU-Ld for submit@debbugs.gnu.org; Sat, 06 Jan 2018 03:45:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXk6i-0007XV-W0 for guix-patches@gnu.org; Sat, 06 Jan 2018 03:45:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXk6f-0002Sw-3L for guix-patches@gnu.org; Sat, 06 Jan 2018 03:45:37 -0500 Received: from rezeros.cc ([2001:19f0:7001:2f3e:5400:ff:fe84:e55d]:38626) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXk6e-0002S1-LM for guix-patches@gnu.org; Sat, 06 Jan 2018 03:45:33 -0500 Received: from localhost (135.37.74.218.broad.hz.zj.dynamic.163data.com.cn [218.74.37.135]) by rezeros.cc (OpenSMTPD) with ESMTPSA id bcb94ee0 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sat, 6 Jan 2018 08:44:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id b2eef774; Sat, 6 Jan 2018 08:45:24 +0000 (UTC) From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= To: guix-patches@gnu.org Subject: [PATCH 2/2] gnu: services: Add darkstat service. Date: Sat, 6 Jan 2018 16:45:23 +0800 Message-Id: <20180106084523.29095-2-iyzsong@member.fsf.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180106084523.29095-1-iyzsong@member.fsf.org> References: <20180106084523.29095-1-iyzsong@member.fsf.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * gnu/services/monitoring.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi (Monitoring Services): Document it. --- doc/guix.texi | 42 +++++++++++++++++++++ gnu/local.mk | 1 + gnu/services/monitoring.scm | 91 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 gnu/services/monitoring.scm diff --git a/doc/guix.texi b/doc/guix.texi index 1d1f30f00..f9dec3082 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14697,6 +14697,48 @@ the 2nd element of the pair is the password. @end deftp +@subsubheading Darkstat Service +@cindex darkstat +@command{darkstat} is a packet sniffer that captures network traffic, +calculates statistics about usage, and serves reports over HTTP. + +@defvar {Scheme Variable} darkstat-service-type +This is the service type for the +@uref{https://unix4lyfe.org/darkstat/, darkstat} +service, its value must be a @code{darkstat-configuration} record as in +this example: + +@example +(service darkstat-service-type + (darkstat-configuration + (interface "eth0"))) +@end example +@end defvar + +@deftp {Data Type} darkstat-configuration +Data type representing the configuration of @command{darkstat}. + +@table @asis +@item @code{package} (default: @code{darstat}) +The darkstat package to use. + +@item @code{interface} +Capture traffic on the specified network interface. + +@item @code{port} (default: @code{"667"}) +Bind the web interface to the specified port. + +@item @code{bindaddr} (default: @code{"127.0.0.1"}) +Bind the web interface to the specified address. + +@item @code{base} (default: @code{"/"}) +Specify the path of the base URL. This can be useful if +@command{darkstat} is accessed via a reverse proxy. + +@end table +@end deftp + + @node Kerberos Services @subsubsection Kerberos Services @cindex Kerberos diff --git a/gnu/local.mk b/gnu/local.mk index 679c119a5..62fcd2cd4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -460,6 +460,7 @@ GNU_SYSTEM_MODULES = \ %D%/services/mail.scm \ %D%/services/mcron.scm \ %D%/services/messaging.scm \ + %D%/services/monitoring.scm \ %D%/services/networking.scm \ %D%/services/nfs.scm \ %D%/services/shepherd.scm \ diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm new file mode 100644 index 000000000..438d66596 --- /dev/null +++ b/gnu/services/monitoring.scm @@ -0,0 +1,91 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018 Sou Bunnbu +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services monitoring) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + #:use-module (gnu packages admin) + #:use-module (gnu packages monitoring) + #:use-module (gnu system shadow) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:export (darkstat-configuration + darkstat-service-type)) + + +;;; +;;; darkstat +;;; + +(define-record-type* + darkstat-configuration make-darkstat-configuration darkstat-configuration? + (package darkstat-configuration-package + (default darkstat)) + (interface darkstat-configuration-interface) + (port darkstat-configuration-port + (default "667")) + (bindaddr darkstat-configuration-bindaddr + (default "127.0.0.1")) + (base darkstat-configuration-base + (default "/"))) + +(define %darkstat-accounts + (list (user-account + (name "darkstat") + (group "darkstat") + (system? #t) + (comment "darkstat daemon user") + (home-directory "/var/lib/darkstat") + (shell (file-append shadow "/sbin/nologin"))) + (user-group + (name "darkstat") + (system? #t)))) + +(define darkstat-shepherd-service + (match-lambda + (($ + package interface port bindaddr base) + (shepherd-service + (documentation "Network statistics gatherer.") + (provision '(darkstat)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/darkstat") + "-i" #$interface + "-p" #$port + "-b" #$bindaddr + "--base" #$base + "--syslog" "--no-daemon" + "--chroot" "/var/lib/darkstat" + "--user" "darkstat" + "--import" "darkstat.db" + "--export" "darkstat.db"))) + (stop #~(make-kill-destructor)))))) + +(define darkstat-service-type + (service-type + (name 'darkstat) + (description + "Run @command{darkstat} to serve network traffic statictics reports over +HTTP.") + (extensions + (list (service-extension account-service-type + (const %darkstat-accounts)) + (service-extension shepherd-root-service-type + (compose list darkstat-shepherd-service)))))) -- 2.13.3 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 07 08:21:32 2018 Received: (at 30003) by debbugs.gnu.org; 7 Jan 2018 13:21:33 +0000 Received: from localhost ([127.0.0.1]:38783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYAtI-0005CW-My for submit@debbugs.gnu.org; Sun, 07 Jan 2018 08:21:32 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:52684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYAtD-0005CK-PV for 30003@debbugs.gnu.org; Sun, 07 Jan 2018 08:21:31 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C7DDA1087B; Sun, 7 Jan 2018 14:21:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2L94pTJJjToI; Sun, 7 Jan 2018 14:21:25 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A7CDE10877; Sun, 7 Jan 2018 14:21:24 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: =?utf-8?B?5a6L5paH5q2m?= Subject: Re: [bug#30003] [PATCH 2/2] gnu: services: Add darkstat service. References: <20180106084523.29095-1-iyzsong@member.fsf.org> <20180106084523.29095-2-iyzsong@member.fsf.org> Date: Sun, 07 Jan 2018 14:21:22 +0100 In-Reply-To: <20180106084523.29095-2-iyzsong@member.fsf.org> (=?utf-8?B?IuWui+aWh+atpiIncw==?= message of "Sat, 6 Jan 2018 16:45:23 +0800") Message-ID: <87o9m5rei5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30003 Cc: 30003@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello, =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > * gnu/services/monitoring.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. > * doc/guix.texi (Monitoring Services): Document it. Nice! I only have minor suggestions: > +@subsubheading Darkstat Service > +@cindex darkstat > +@command{darkstat} is a packet sniffer that captures network traffic, I think you can remove @command since you=E2=80=99re referring to the softw= are, not to the command. > +@example > +(service darkstat-service-type > + (darkstat-configuration > + (interface "eth0"))) This should be aligned to the right. Also perhaps s/eth0/eno1/ to match common names. > +@item @code{package} (default: @code{darstat}) ^ Typo. > +@item @code{bindaddr} (default: @code{"127.0.0.1"}) I=E2=80=99d prefer =E2=80=9Caddress=E2=80=9D or =E2=80=9Clisten-address=E2= =80=9D or =E2=80=9Cbind-address=E2=80=9D (likewise in the code.) Otherwise LGTM, thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 08 07:59:38 2018 Received: (at 30003-done) by debbugs.gnu.org; 8 Jan 2018 12:59:38 +0000 Received: from localhost ([127.0.0.1]:40299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYX1e-0005Uy-MP for submit@debbugs.gnu.org; Mon, 08 Jan 2018 07:59:38 -0500 Received: from rezeros.cc ([45.76.207.221]:42798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYX1a-0005Un-OJ for 30003-done@debbugs.gnu.org; Mon, 08 Jan 2018 07:59:37 -0500 Received: from localhost (115.197.96.181 [115.197.96.181]) by rezeros.cc (OpenSMTPD) with ESMTPSA id a59e001a (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 8 Jan 2018 12:59:01 +0000 (UTC) Received: from gift (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 64dfb830; Mon, 8 Jan 2018 12:59:26 +0000 (UTC) From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#30003] [PATCH 2/2] gnu: services: Add darkstat service. References: <20180106084523.29095-1-iyzsong@member.fsf.org> <20180106084523.29095-2-iyzsong@member.fsf.org> <87o9m5rei5.fsf@gnu.org> Date: Mon, 08 Jan 2018 20:59:26 +0800 In-Reply-To: <87o9m5rei5.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 07 Jan 2018 14:21:22 +0100") Message-ID: <87r2r0ik0h.fsf@member.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30003-done Cc: 30003-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hello, > > =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > >> * gnu/services/monitoring.scm: New file. >> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. >> * doc/guix.texi (Monitoring Services): Document it. > > Nice! > > I only have minor suggestions: > >> +@subsubheading Darkstat Service >> +@cindex darkstat >> +@command{darkstat} is a packet sniffer that captures network traffic, > > I think you can remove @command since you=E2=80=99re referring to the sof= tware, > not to the command. > >> +@example >> +(service darkstat-service-type >> + (darkstat-configuration >> + (interface "eth0"))) > > This should be aligned to the right. Also perhaps s/eth0/eno1/ to match > common names. > >> +@item @code{package} (default: @code{darstat}) > ^ > Typo. > >> +@item @code{bindaddr} (default: @code{"127.0.0.1"}) > > I=E2=80=99d prefer =E2=80=9Caddress=E2=80=9D or =E2=80=9Clisten-address= =E2=80=9D or =E2=80=9Cbind-address=E2=80=9D (likewise in > the code.) > > Otherwise LGTM, thank you! Done, thanks for the review! From unknown Tue Sep 09 02:38:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 06 Feb 2018 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator