unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] service: systemd: use correct format for LISTEN_FDNAMES
@ 2022-05-06 23:14 Bastien Rivière
  2022-05-07 23:17 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Bastien Rivière @ 2022-05-06 23:14 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

Hello,

This is a patch for shepherd's "make-systemd-constructor" which creates an invalid environment variable when there is more than one listen endpoint.

Best regards,
Bastien

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-service-systemd-use-correct-format-for-LISTEN_FDNAME.patch --]
[-- Type: text/x-patch; name="0001-service-systemd-use-correct-format-for-LISTEN_FDNAME.patch", Size: 1745 bytes --]

From fdabd4ee6d43e32cbf9bd85282ff66138ce652b9 Mon Sep 17 00:00:00 2001
From: Bastien Riviere <me@babariviere.com>
Date: Sat, 7 May 2022 01:08:28 +0200
Subject: [PATCH] service: systemd: use correct format for LISTEN_FDNAMES

As in the documentation, LISTEN_FDNAMES is expected to be a "colon-separated
list of names".
This patch add the missing delimiter when joining to LISTEN_FDNAMES.

This fixes issues with services, like gpg-agent, which produces this kind of
error:

> [gpg-agent] Fatal: number of items in LISTEN_FDNAMES (1) does not match LISTEN_FDS (4) in --supervised mode
---
 modules/shepherd/service.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 81bd667..f343938 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -352,7 +352,7 @@ wire."
 (define-method (running? (obj <service>))
   (and (service-running-value obj) #t))
 
-;; Return a list of all actions implemented by OBJ. 
+;; Return a list of all actions implemented by OBJ.
 (define-method (action-list (obj <service>))
   (map action-name (slot-ref obj 'actions)))
 
@@ -1594,7 +1594,8 @@ This must be paired with @code{make-systemd-destructor}."
                                            (number->string (length sockets)))
                             (string-append "LISTEN_FDNAMES="
                                            (string-join
-                                            (map endpoint-name endpoints)))))
+                                            (map endpoint-name endpoints)
+                                            ":"))))
            (running   sockets))
       (spawn-fiber
        (lambda ()
-- 
me@babariviere.com


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] service: systemd: use correct format for LISTEN_FDNAMES
  2022-05-06 23:14 [PATCH] service: systemd: use correct format for LISTEN_FDNAMES Bastien Rivière
@ 2022-05-07 23:17 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2022-05-07 23:17 UTC (permalink / raw)
  To: Bastien Rivière; +Cc: guix-devel

Hi Bastien,

Bastien Rivière <me@babariviere.com> skribis:

> From fdabd4ee6d43e32cbf9bd85282ff66138ce652b9 Mon Sep 17 00:00:00 2001
> From: Bastien Riviere <me@babariviere.com>
> Date: Sat, 7 May 2022 01:08:28 +0200
> Subject: [PATCH] service: systemd: use correct format for LISTEN_FDNAMES
>
> As in the documentation, LISTEN_FDNAMES is expected to be a "colon-separated
> list of names".
> This patch add the missing delimiter when joining to LISTEN_FDNAMES.
>
> This fixes issues with services, like gpg-agent, which produces this kind of
> error:
>
>> [gpg-agent] Fatal: number of items in LISTEN_FDNAMES (1) does not match LISTEN_FDS (4) in --supervised mode
> ---
>  modules/shepherd/service.scm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Good catch.  I tweaked the commit log and pushed it as
74817c475b4d66923df89802e50666257dc82a68.

Thank you!

Ludo’.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-07 23:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 23:14 [PATCH] service: systemd: use correct format for LISTEN_FDNAMES Bastien Rivière
2022-05-07 23:17 ` Ludovic Courtès

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).