From unknown Thu Jun 19 14:28:23 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#59197 <59197@debbugs.gnu.org> To: bug#59197 <59197@debbugs.gnu.org> Subject: Status: [PATCH 0/3] Support 'herd configuration SERVICE' to view config file Reply-To: bug#59197 <59197@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:28:23 +0000 retitle 59197 [PATCH 0/3] Support 'herd configuration SERVICE' to view conf= ig file reassign 59197 guix-patches submitter 59197 Ludovic Court=C3=A8s severity 59197 normal tag 59197 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 13:11:45 2022 Received: (at submit) by debbugs.gnu.org; 11 Nov 2022 18:11:45 +0000 Received: from localhost ([127.0.0.1]:46698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otYVE-0006A4-N6 for submit@debbugs.gnu.org; Fri, 11 Nov 2022 13:11:44 -0500 Received: from lists.gnu.org ([209.51.188.17]:36538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otYVB-00069w-UC for submit@debbugs.gnu.org; Fri, 11 Nov 2022 13:11:42 -0500 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 1otYVB-0004mC-PW for guix-patches@gnu.org; Fri, 11 Nov 2022 13:11:41 -0500 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 1otYVB-0002JE-Gz; Fri, 11 Nov 2022 13:11:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=WHXASFORIDReIV2J/arv54FUHKaGhvce7mJERNfNE6w=; b=HotVRomTFgqULf YdfcPMXLFKclneTdl2ivw0mvXQRAL5tR+sHf/Todcu28j/fKpniPJpVWlNUqZdvaTDoV8VipLdTC/ sjALr2lzmU4Xd3dV1qtRnjArzSGMgd7uZmu4iQoiyGxHCYaoREns0JaXw4h7tgs7UTeyV6sSbUjzD fcNkt/8yON20N1uEEGEjA4z37+LnrrjboT1jLjkKlAEaDtDt5M5xRuOFzOuFYoSoIb0tj0/xUVJ06 mWgpaqRAQ1rE60bYdOtIZHt2/r9dgQJrmnrhS6f5rPXjU5iPl8ubU9c7aPNOaoCOsPl6XTNFTUGSB R7ctDybg953hxoSXWwYg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otYVA-0002lU-Sh; Fri, 11 Nov 2022 13:11:41 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/3] Support 'herd configuration SERVICE' to view config file Date: Fri, 11 Nov 2022 19:11:31 +0100 Message-Id: <20221111181131.4171-1-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) Hi! So far, to view the config file of sshd, elogind, etc., you'd have to do: cat /proc/PID/cmdline | xargs -0 or sometimes: cat /proc/PID/environ | xargs -0 and extract the config file name from there. With this change, you can do: cat $(herd configuration elogind) or similar. Simple but convenient. This patch series adds it to a few core services. Adding it elsewhere is left as an exercise to the reader. :-) Thoughts? Ludo’. Ludovic Courtès (3): services: shepherd: Define 'shepherd-configuration-action' helper. services: Add Shepherd 'configuration' action to various services. home: services: redshift: Add 'configuration' action. doc/guix.texi | 11 +++++++++++ gnu/home/services/desktop.scm | 3 ++- gnu/home/services/shepherd.scm | 3 ++- gnu/services/avahi.scm | 5 +++-- gnu/services/base.scm | 5 +++-- gnu/services/desktop.scm | 12 ++++++++---- gnu/services/networking.scm | 4 +++- gnu/services/shepherd.scm | 12 ++++++++++++ gnu/services/ssh.scm | 6 +++++- gnu/services/web.scm | 7 +++---- gnu/services/xorg.scm | 10 ++++++---- gnu/tests/base.scm | 6 ++++++ 12 files changed, 64 insertions(+), 20 deletions(-) base-commit: 1f5e8ef14ffa385907fc94a754cfff7a45fee50c prerequisite-patch-id: ee11d213a4ee466dff6379eeaeea292b6ba93fb0 prerequisite-patch-id: 857e9a0f3d1bc9ad5584c44bc767683a53e44972 prerequisite-patch-id: b87a0615ac48fe8950281f797cd2d096a98f4a2c prerequisite-patch-id: c554e46d5d315cd349df21ba153ef6ed580f0b3c -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 13:13:02 2022 Received: (at 59197) by debbugs.gnu.org; 11 Nov 2022 18:13:02 +0000 Received: from localhost ([127.0.0.1]:46706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otYWU-0006D0-3o for submit@debbugs.gnu.org; Fri, 11 Nov 2022 13:13:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otYWR-0006CS-Jj for 59197@debbugs.gnu.org; Fri, 11 Nov 2022 13:13:00 -0500 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 1otYWM-0002QK-5I; Fri, 11 Nov 2022 13:12:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=RezMu7rBRKb8VN4OIYPT/e7J8UNnusK7WgeEphpjF/w=; b=lTmiqjb+lhe3wR BqlW5JtUVKndZDUfPwjn5+OXxLKRrmH3v5LVvlpADKTZONca0eB0nHDkt/JB2Kv9f8a4R3FeK9rTn Hd9mIS4Sv06zlrTS4KTcuUeiqLs8dmwdW2Qonj61PRslkB8VNPYDlV5vw2Z1YveqBOLI9rWW3ists m6bpsOVhbT4O8Q1LZ2GTELxrP/idLUJzOteUSXfYiBY0ahUtAgBDP2HQ3KdlJqZhdPtGMc8NHjy+P 6XL6iyD14n38Y1z3yI/9TXEnd0iKppyHkH+1IpM/ZVrjaNc4sY+C/c4yEVNpYg4/xOD0jGU+md0Ao 41MjKxs50Qliu52Q00rw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otYWL-00032K-M8; Fri, 11 Nov 2022 13:12:53 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 59197@debbugs.gnu.org Subject: [PATCH 1/3] services: shepherd: Define 'shepherd-configuration-action' helper. Date: Fri, 11 Nov 2022 19:12:44 +0100 Message-Id: <20221111181246.4217-1-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59197 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) * gnu/services/shepherd.scm (shepherd-configuration-action): New procedure. --- gnu/services/shepherd.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 7110e5aa89..b2601c0128 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -66,6 +66,8 @@ (define-module (gnu services shepherd) shepherd-action-documentation shepherd-action-procedure + shepherd-configuration-action + %default-modules shepherd-service-file @@ -333,6 +335,16 @@ (define shepherd&co #:options '(#:local-build? #t #:substitutable? #f))))) +(define (shepherd-configuration-action file) + "Return a 'configuration' action to display FILE, which should be the name +of the service's configuration file." + (shepherd-action + (name 'configuration) + (documentation "Display the name of this service's configuration file.") + (procedure #~(lambda (_) + (format #t "~a~%" #$file) + #$file)))) + (define (shepherd-configuration-file services shepherd) "Return the shepherd configuration file for SERVICES. SHEPHERD is used as shepherd package." -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 13:13:08 2022 Received: (at 59197) by debbugs.gnu.org; 11 Nov 2022 18:13:08 +0000 Received: from localhost ([127.0.0.1]:46712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otYWZ-0006DZ-K0 for submit@debbugs.gnu.org; Fri, 11 Nov 2022 13:13:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otYWX-0006Cg-LF for 59197@debbugs.gnu.org; Fri, 11 Nov 2022 13:13:06 -0500 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 1otYWR-0002Qj-IV; Fri, 11 Nov 2022 13:13:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=EhbWe93zrttSgWVN9CG4sZbVWMgCKhry4dhbMEIS2Sk=; b=LZhzpTfMLvbSEJxjv2xD SRefoZBuOUwKTTMguuFavHq/ga+W2h8iAOCd5udO/s25/rBBwkgR9kzNDTSEBgpFtQNP6mSY1F3in 7F2ubEItnNh7i271Au5JwDz58XYdjq9+QQdQE25beUAfAhYP9JyA7wMxftdfSpLBAxXfhYhslf2ho 8eWnkbQc9zGVxmObG707pkn75V82VLqduC394VkGCrFXS64zYRnSsxKU7ZgPzqpMsvpZ0bcVKYw4H svkxOO/SSvzZUyQQj9oDmnMJyiWYUphMs4NRo5DIzsfAeYapoGgo9vGrrtlRyEPfp4sChrbSmTu+o zD0mnH7wYL1iCg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otYWO-00032K-Qf; Fri, 11 Nov 2022 13:12:59 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 59197@debbugs.gnu.org Subject: [PATCH 2/3] services: Add Shepherd 'configuration' action to various services. Date: Fri, 11 Nov 2022 19:12:45 +0100 Message-Id: <20221111181246.4217-2-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221111181246.4217-1-ludo@gnu.org> References: <20221111181246.4217-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59197 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) * gnu/services/avahi.scm (avahi-shepherd-service): Add 'actions' field. * gnu/services/base.scm (nscd-actions): Add call to 'shepherd-configuration-action'. * gnu/services/desktop.scm (upower-shepherd-service): Add 'actions' field. (elogind-shepherd-service): Likewise. * gnu/services/networking.scm (openntpd-shepherd-service): Likewise. (tor-shepherd-service): Likewise. * gnu/services/ssh.scm (openssh-shepherd-service): Likewise. * gnu/services/web.scm (nginx-shepherd-service): Likewise. * gnu/services/xorg.scm (gdm-shepherd-service): Likewise. * gnu/tests/base.scm (run-basic-test)["nscd configuration action"]: New test. * doc/guix.texi (Services): Document it. --- doc/guix.texi | 11 +++++++++++ gnu/services/avahi.scm | 5 +++-- gnu/services/base.scm | 5 +++-- gnu/services/desktop.scm | 12 ++++++++---- gnu/services/networking.scm | 4 +++- gnu/services/ssh.scm | 6 +++++- gnu/services/web.scm | 7 +++---- gnu/services/xorg.scm | 10 ++++++---- gnu/tests/base.scm | 6 ++++++ 9 files changed, 48 insertions(+), 18 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3f76184495..6955108eed 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17643,6 +17643,17 @@ Service xorg-server has been stopped. Service xorg-server has been started. @end example +@cindex configuration, action for shepherd services +@cindex configuration file, of a shepherd service +For some services, @command{herd configuration} returns the name of the +service's configuration file, which can be handy to inspect its +configuration: + +@example +# herd configuration sshd +/gnu/store/@dots{}-sshd_config +@end example + The following sections document the available services, starting with the core services, that may be used in an @code{operating-system} declaration. diff --git a/gnu/services/avahi.scm b/gnu/services/avahi.scm index 3b8d0512c7..1c4220e490 100644 --- a/gnu/services/avahi.scm +++ b/gnu/services/avahi.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2014-2020, 2022 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -137,7 +137,8 @@ (define (avahi-shepherd-service config) #$@(if debug? #~("--debug") #~()) "-f" #$config) #:pid-file "/run/avahi-daemon/pid")) - (stop #~(make-kill-destructor)))))) + (stop #~(make-kill-destructor)) + (actions (list (shepherd-configuration-action config))))))) (define avahi-service-type (let ((avahi-package (compose list avahi-configuration-avahi))) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 3bf924b8f1..d99548573d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1327,10 +1327,11 @@ (define (nscd-action-procedure nscd config option) (loop))))))) (define (nscd-actions nscd config) - "Return Shepherd actions for NSCD." + "Return Shepherd actions for NSCD using CONFIG its config file." ;; Make this functionality available as actions because that's a simple way ;; to run the right 'nscd' binary with the right config file. - (list (shepherd-action + (list (shepherd-configuration-action config) + (shepherd-action (name 'statistics) (documentation "Display statistics about nscd usage.") (procedure (nscd-action-procedure nscd config "--statistics"))) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 1b087635d1..ac29e8d38a 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -273,7 +273,8 @@ (define (upower-shepherd-service config) #:environment-variables (list (string-append "UPOWER_CONF_FILE_NAME=" #$config)))) - (stop #~(make-kill-destructor)))))) + (stop #~(make-kill-destructor)) + (actions (list (shepherd-configuration-action config))))))) (define upower-service-type (let ((upower-package (compose list upower-configuration-upower))) @@ -1168,6 +1169,9 @@ (module (file-append (elogind-package config) (define (elogind-shepherd-service config) "Return a Shepherd service to start elogind according to @var{config}." + (define config-file + (elogind-configuration-file config)) + (list (shepherd-service (requirement '(dbus-system)) (provision '(elogind)) @@ -1176,9 +1180,9 @@ (define (elogind-shepherd-service config) "/libexec/elogind/elogind")) #:environment-variables (list (string-append "ELOGIND_CONF_FILE=" - #$(elogind-configuration-file - config))))) - (stop #~(make-kill-destructor))))) + #$config-file)))) + (stop #~(make-kill-destructor)) + (actions (list (shepherd-configuration-action config-file)))))) (define elogind-service-type (service-type (name 'elogind) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 19aba8c266..18d1eb5b8c 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -652,7 +652,8 @@ (define ntpd.conf ;; while running, leading shepherd to disable it. To ;; prevent spamming stderr, redirect output to logfile. #:log-file "/var/log/ntpd.log")) - (stop #~(make-kill-destructor)))))) + (stop #~(make-kill-destructor)) + (actions (list (shepherd-configuration-action ntpd.conf))))))) (define (openntpd-service-activation config) "Return the activation gexp for CONFIG." @@ -1032,6 +1033,7 @@ (define (tor-shepherd-service config) (list #$tor "-f" #$torrc) #:user "tor" #:group "tor")) (stop #~(make-kill-destructor)) + (actions (list (shepherd-configuration-action torrc))) (documentation "Run the Tor anonymous network overlay.")))))))) (define (tor-activation config) diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 72e7183590..7b038e6ac6 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -524,9 +524,12 @@ (define port-number (define max-connections (openssh-configuration-max-connections config)) + (define config-file + (openssh-config-file config)) + (define openssh-command #~(list (string-append #$(openssh-configuration-openssh config) "/sbin/sshd") - "-D" "-f" #$(openssh-config-file config))) + "-D" "-f" #$config-file)) (define inetd-style? ;; Whether to use 'make-inetd-constructor'. That procedure appeared in @@ -568,6 +571,7 @@ (define ipv6-support? (stop #~(if #$inetd-style? (make-inetd-destructor) (make-kill-destructor))) + (actions (list (shepherd-configuration-action config-file))) (auto-start? (openssh-auto-start? config))))) (define (openssh-pam-services config) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 2023119037..bf321f8f1b 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -790,13 +790,11 @@ (define (nginx-shepherd-service config) (nginx file run-directory shepherd-requirement) (let* ((nginx-binary (file-append nginx "/sbin/nginx")) (pid-file (in-vicinity run-directory "pid")) + (config-file (or file (default-nginx-config config))) (nginx-action (lambda args #~(lambda _ - (invoke #$nginx-binary "-c" - #$(or file - (default-nginx-config config)) - #$@args) + (invoke #$nginx-binary "-c" #$config-file #$@args) (match '#$args (("-s" . _) #f) (_ @@ -817,6 +815,7 @@ (define (nginx-shepherd-service config) (stop (nginx-action "-s" "stop")) (actions (list + (shepherd-configuration-action config-file) (shepherd-action (name 'reload) (documentation "Reload nginx configuration file and restart worker processes. diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 7f1f0bb581..5f073d05d3 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Andy Wingo -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès +;;; Copyright © 2013-2017, 2019-2020, 2022 Ludovic Courtès ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2018, 2019 Timothy Sample ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen @@ -1083,6 +1083,9 @@ (module "pam_permit.so"))))) (gdm-configuration-allow-empty-passwords? config)))) (define (gdm-shepherd-service config) + (define config-file + (gdm-configuration-file config)) + (list (shepherd-service (documentation "Xorg display server (GDM)") (provision '(xorg-server)) @@ -1095,9 +1098,7 @@ (define (gdm-shepherd-service config) (list #$@(if (gdm-configuration-auto-suspend? config) #~() #~("DCONF_PROFILE=/etc/dconf/profile/gdm")) - (string-append - "GDM_CUSTOM_CONF=" - #$(gdm-configuration-file config)) + (string-append "GDM_CUSTOM_CONF=" #$config-file) (string-append "GDM_DBUS_DAEMON=" #$(gdm-configuration-dbus-daemon config)) @@ -1129,6 +1130,7 @@ (define (gdm-shepherd-service config) "GDM_WAYLAND_SESSION=" #$(gdm-configuration-wayland-session config)))))) (stop #~(make-kill-destructor)) + (actions (list (shepherd-configuration-action config-file))) (respawn? #t)))) (define gdm-polkit-rules diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 64cd6a911a..7200a28606 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -424,6 +424,12 @@ (define (entry->list entry) (x (pk 'failure x #f)))) + (test-assert "nscd configuration action" + (marionette-eval '(with-shepherd-action 'nscd ('configuration) + results + (file-exists? (car results))) + marionette)) + (test-equal "nscd invalidate action" '(#t) ;one value, #t (marionette-eval '(with-shepherd-action 'nscd ('invalidate "hosts") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 13:13:13 2022 Received: (at 59197) by debbugs.gnu.org; 11 Nov 2022 18:13:13 +0000 Received: from localhost ([127.0.0.1]:46714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otYWc-0006Di-Dt for submit@debbugs.gnu.org; Fri, 11 Nov 2022 13:13:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otYWY-0006Co-R8 for 59197@debbugs.gnu.org; Fri, 11 Nov 2022 13:13:07 -0500 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 1otYWT-0002Qv-Jh; Fri, 11 Nov 2022 13:13:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Po47+cuwNe91RouGrardSvHUB0L62A8oYcRSVZgtnWM=; b=brk9N+caqR/bJ+b/sfu8 GDUrUiy7fEuFkLbTADVVW4XXz13SqKEwkUcaT4/bhw4xkhBZ+Vw/xnGWXt6SjxG2+WdgGVMk0RIe/ D+pBV7u1JyVs1/oeYh23LO+oVnQ+VkGnOCb7MYr1uHZg2Im0jnaoLXo49MR/BzmWyMsfcMZDz1Ych YXiNDRiMKsOImnYPMI0grk8Uix7hd4uzZ4sr+RvyNM9NRcV6XfIhNrZjiX9yVAaA3eeiPe6yIk+Z2 /bRG40MwU7QbMoQC8A5WSfW/9Ihh02kb6VgTYb4dIsEfkD6+69Hmk5hRqAD9hxwrAl3MCViNU0A8L pfVfruomoCIWTw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otYWR-00032K-Ox; Fri, 11 Nov 2022 13:13:01 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 59197@debbugs.gnu.org Subject: [PATCH 3/3] home: services: redshift: Add 'configuration' action. Date: Fri, 11 Nov 2022 19:12:46 +0100 Message-Id: <20221111181246.4217-3-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221111181246.4217-1-ludo@gnu.org> References: <20221111181246.4217-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59197 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) * gnu/home/services/shepherd.scm: Re-export 'shepherd-configuration-action'. * gnu/home/services/desktop.scm (redshift-shepherd-service): Add 'actions' field. --- gnu/home/services/desktop.scm | 3 ++- gnu/home/services/shepherd.scm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm index 1ebfb14f3c..cb25b03b64 100644 --- a/gnu/home/services/desktop.scm +++ b/gnu/home/services/desktop.scm @@ -165,7 +165,8 @@ (define config-file (start #~(make-forkexec-constructor (list #$(file-append redshift "/bin/redshift") "-c" #$config-file))) - (stop #~(make-kill-destructor))))) + (stop #~(make-kill-destructor)) + (actions (list (shepherd-configuration-action config-file)))))) (define home-redshift-service-type (service-type diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm index d2a803279f..1a70a220f0 100644 --- a/gnu/home/services/shepherd.scm +++ b/gnu/home/services/shepherd.scm @@ -45,7 +45,8 @@ (define-module (gnu home services shepherd) shepherd-service-auto-start? shepherd-service-modules - shepherd-action)) + shepherd-action + shepherd-configuration-action)) (define-record-type* home-shepherd-configuration make-home-shepherd-configuration -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 13 21:16:07 2022 Received: (at 59197) by debbugs.gnu.org; 14 Nov 2022 02:16:07 +0000 Received: from localhost ([127.0.0.1]:48723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouP15-0001SK-AP for submit@debbugs.gnu.org; Sun, 13 Nov 2022 21:16:07 -0500 Received: from mail.envs.net ([5.199.136.28]:34264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouP12-0001SB-TW for 59197@debbugs.gnu.org; Sun, 13 Nov 2022 21:16:06 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 35F7E38A0033; Mon, 14 Nov 2022 02:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1668392164; bh=3K2jVYiu1/y/HkR+st5hq9+3x8rS0Wnr0vfwRpBCjrc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ljfClAlnQg5nNWma+GpfEH+6gaHND+LdqHdAxOS7hgxvw1h1I1hSed03Kf/ATO7oe /MLQ+s8p6BTIu8EwAjL17iTuhxq1IvdstpkDG2YQ0Jpnt0l1XR3vPTL4rE6DFNTw4O Yj3HQITQg+87T/XpyLUlXDApkXdmtnvYzDvmvLsMdmPUK/zyyVlD2siIUH1x1aMmrb pXpkIG/zoNNzTQcGsKh1a8mJcfRIswK+M4xXVoMOo3IZ5W/PcMBygm+bW++OBW9Z49 Hy2FYltSXAbyXd/sHP/2K/6f2/39PnWodDdztwMcFkWbN3GPWigV8BnRHLykGrDwK1 JQCucigyuzKMtOZi4c8HsY/lVFNGcKxQ1qOA7oQyyo/HjMFAEcB5rOr3ZH6YubH3g5 0cdncGdo2wd3BmfVEeRD1bWCiVWb916T+uoMjXIrWlqggyuOVx+v30cPdcmEw61b9/ 35B+Zl08ga6E70BO0tLbMPCajDYQnaAUm1MIpSSD+dNsXIhfPye+EOb0CHTzE+6QdZ lxj6Mu7J9miFiuTwjs4a/LSe3ctWiLm57hbs39cdnJE8icmX9vEmaPbs+ndoertX1w WNE0QKvJr8+Hv4yGFGxcOtwMa8z/H/9gN8jTBwt1c1adNaM6730ZWRP1hXIK5ind5L ESs7zidzsgPM6R6b68Pcjgi0= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lGL-r63m4fs9; Mon, 14 Nov 2022 02:16:01 +0000 (UTC) Received: from localhost (unknown [182.150.116.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Mon, 14 Nov 2022 02:16:01 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 5694ff69; Mon, 14 Nov 2022 02:16:02 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#59197: [PATCH 0/3] Support 'herd configuration SERVICE' to view config file References: <20221111181131.4171-1-ludo@gnu.org> Date: Mon, 14 Nov 2022 10:16:02 +0800 In-Reply-To: <20221111181131.4171-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s=22's?= message of "Fri, 11 Nov 2022 19:11:31 +0100") Message-ID: <87a64ub7rx.fsf@envs.net> 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-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59197 Cc: 59197@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 (-) Ludovic Court=C3=A8s writes: > Hi! > > So far, to view the config file of sshd, elogind, etc., you'd have to do: > > cat /proc/PID/cmdline | xargs -0 > > or sometimes: > > cat /proc/PID/environ | xargs -0 > > and extract the config file name from there. > > With this change, you can do: > > cat $(herd configuration elogind) > > or similar. Simple but convenient. > > This patch series adds it to a few core services. Adding it elsewhere > is left as an exercise to the reader. :-) Look great to me, thank you! From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 09:52:27 2022 Received: (at 59197-done) by debbugs.gnu.org; 18 Nov 2022 14:52:27 +0000 Received: from localhost ([127.0.0.1]:35977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow2jD-0001g6-1s for submit@debbugs.gnu.org; Fri, 18 Nov 2022 09:52:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow2jA-0001fp-2k for 59197-done@debbugs.gnu.org; Fri, 18 Nov 2022 09:52:25 -0500 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 1ow2j3-0006Qy-Ry; Fri, 18 Nov 2022 09:52:17 -0500 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=A9Z+o14NRYA53MiS7MoaBosC78lII+u6N99EniHHDpo=; b=OOtGHCdPhy39GTT4eiTh /QyJYDS9kYgFkPxwanK/BGxiV+lN1z42t6L6c98JqeEFmFmIpsPD4PizaBIjZubAn5rGGshKpUjQ/ JyvolRi3u1lM5xIVCbbvM5JR448+fkPhCMwFr1dyb/bys8qZHAZL6zTGPbhSt2AeqE7zKFZ4T3mB0 bfWTRJeSznvPP4nje6Z9ol8Z2wdI1nBDm/VdI+l1fjfA6JYK7fIS0cyQVp3bcXZ0DhyqER5q2ItPP DjDS8PtHM444vWZ9U2xKou1ZXOe0a2NoggkONwrMg5Ic/2AXV7Gh1ndrRInbL+c/9CWrDeK7iwB25 SQAsaTb+cfPFjw==; Received: from [193.50.110.147] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow2j3-0005hM-ED; Fri, 18 Nov 2022 09:52:17 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?B?5a6L5paH5q2m?= Subject: Re: bug#59197: [PATCH 0/3] Support 'herd configuration SERVICE' to view config file References: <20221111181131.4171-1-ludo@gnu.org> <87a64ub7rx.fsf@envs.net> Date: Fri, 18 Nov 2022 15:52:14 +0100 In-Reply-To: <87a64ub7rx.fsf@envs.net> (=?utf-8?B?IuWui+aWh+atpiIncw==?= message of "Mon, 14 Nov 2022 10:16:02 +0800") Message-ID: <87zgco9uxt.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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59197-done Cc: 59197-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: -3.3 (---) Hi, =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > Ludovic Court=C3=A8s writes: > >> Hi! >> >> So far, to view the config file of sshd, elogind, etc., you'd have to do: >> >> cat /proc/PID/cmdline | xargs -0 >> >> or sometimes: >> >> cat /proc/PID/environ | xargs -0 >> >> and extract the config file name from there. >> >> With this change, you can do: >> >> cat $(herd configuration elogind) >> >> or similar. Simple but convenient. >> >> This patch series adds it to a few core services. Adding it elsewhere >> is left as an exercise to the reader. :-) > > Look great to me, thank you! Thanks for taking a look! I pushed these patches with two minor changes: added the =E2=80=98configura= tion=E2=80=99 action to dicod, and documented =E2=80=98shepherd-configuration-action=E2= =80=99. 8b56983999 home: services: redshift: Add 'configuration' action. 8d9647d8a7 services: Add Shepherd 'configuration' action to various servi= ces. ebc7de6a1e services: shepherd: Define 'shepherd-configuration-action' hel= per. Ludo=E2=80=99. From unknown Thu Jun 19 14:28:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 17 Dec 2022 12:24:13 +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