unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Bastien Rivière" <me@babariviere.com>
To: guix-devel@gnu.org
Subject: [PATCH] service: systemd: use correct format for LISTEN_FDNAMES
Date: Sat, 07 May 2022 01:14:24 +0200	[thread overview]
Message-ID: <e474bbc4-54bb-443b-9c53-800f083d36e7@www.fastmail.com> (raw)

[-- 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


             reply	other threads:[~2022-05-06 23:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 23:14 Bastien Rivière [this message]
2022-05-07 23:17 ` [PATCH] service: systemd: use correct format for LISTEN_FDNAMES Ludovic Courtès

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=e474bbc4-54bb-443b-9c53-800f083d36e7@www.fastmail.com \
    --to=me@babariviere.com \
    --cc=guix-devel@gnu.org \
    /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).