From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aH+1MFuBXGLiSQEAgWs5BA (envelope-from ) for ; Sun, 17 Apr 2022 23:06:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kENdKVuBXGJLpAAAG6o9tA (envelope-from ) for ; Sun, 17 Apr 2022 23:06:35 +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 69111173EF for ; Sun, 17 Apr 2022 23:06:35 +0200 (CEST) Received: from localhost ([::1]:40524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngC6M-0007oD-Ib for larch@yhetil.org; Sun, 17 Apr 2022 17:06:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngC5s-0006Gv-3U for guix-patches@gnu.org; Sun, 17 Apr 2022 17:06:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43546) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ngC5r-0000YC-Qe for guix-patches@gnu.org; Sun, 17 Apr 2022 17:06:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ngC5r-00026H-Jk for guix-patches@gnu.org; Sun, 17 Apr 2022 17:06:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54997] [PATCH 06/12] services: dicod: Use 'make-inetd-constructor'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 Apr 2022 21:06:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54997@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54997-submit@debbugs.gnu.org id=B54997.16502295577971 (code B ref 54997); Sun, 17 Apr 2022 21:06:03 +0000 Received: (at 54997) by debbugs.gnu.org; 17 Apr 2022 21:05:57 +0000 Received: from localhost ([127.0.0.1]:37422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ngC5k-00024U-O4 for submit@debbugs.gnu.org; Sun, 17 Apr 2022 17:05:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ngC5a-00022V-CN for 54997@debbugs.gnu.org; Sun, 17 Apr 2022 17:05:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngC5U-0000Vk-TK; Sun, 17 Apr 2022 17:05:41 -0400 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=MQpPXdmT27Sc0jQcJN7CCKM6M2Rthov0aXprrffF8VE=; b=h7juhjTWv/dHtYXB+umq vpWTNtfdkkA3QcXC202Pq/L0HJ+RoIOL2tTxUcW9b1E+KUhZYOhWn7y3/ae9LBSxq5THXpCWwe3Fb PeIGoRVK07nCxeuqfWsqbM6cAK2P8k44a60z6NdWoYhf3ZR+dS0oVkOvxUDXeOuSCDvR5WCV38zDA JBOrFNy8h2sZA1ol+VAe+MOW0FI0PJZGHHkwCd63cpx0jv6zivK3d8J/1GZZML3g9gla5Pfc79mAH YHuqqgSqMjmts7lBUZSXK1+yKGNUZBoh/ylwKfR7z/bDH+R7v6278Y84UjG0bi/AmqIMfiWeJzqVY hB0D9vGv8mNpUA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38870 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 1ngC5U-000268-Gr; Sun, 17 Apr 2022 17:05:40 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sun, 17 Apr 2022 23:04:47 +0200 Message-Id: <20220417210453.27884-6-ludo@gnu.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220417210453.27884-1-ludo@gnu.org> References: <20220417210453.27884-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650229595; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=MQpPXdmT27Sc0jQcJN7CCKM6M2Rthov0aXprrffF8VE=; b=as8B2MrpvHDGiVyTizOq87F5S9UpWI6z/oqFJN7VcyQTp1X8nIILro0SaczKPusX+QaK3t 5xgommMJQUygk3B8iiIhzwf3/7RqmQ5GZshKKv4t9SQHdZbo8NnfQruB2g86hf/N6g0mXc b74eHmiMKq8QNA9YAvAgx9gEoLaH1IqcCaAuvC7mr9gm+XlgoXzDyjnh8wysE+79+o/Pyc ch2qiy3GC3o5FCAQ5Ecj9pDMSU09/YaVzhQ5bEmVPMKDk9/oZlzbz3xqAGbhUUQOg7ex35 gY3szj9/PK3P7xOaj3iGytLcqDnO4u9kf5gzOb78+WRuevdSQomMmiRtMFHkRg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650229595; a=rsa-sha256; cv=none; b=ZZSRSxkhHFSvsPTPSjOUA28Aqdmb06zGylf9AYKCxsifdxsyeAynUlfAdWN9NdwFc+XX93 SQ1NxVV5nSz0DAm3BXtHUtlL9DUlrIT+Nfv/Ror6SX349QQB/D8bQE4OkY3LlHG2EyACJ9 cg/2quWwdW4xTKsYJyBaM8fCOR7cQBSHAgQ8wBj7uuR/GYJhFbWfTNPcLMSglya5X4DMTG pulQDoF1uwJT2CTNDQLfabQMfxX4sGXEEdPLPhg0CTpG8ZXRtpRD9/gkSt38G2s45B8Zku mh262PIvPs1LIKvkiSV/8a/SYjiVBxu+Qo053mbOsaR7MM2QPQrF4ayrkZMFHw== 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=h7juhjTW; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -1.24 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=h7juhjTW; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 69111173EF X-Spam-Score: -1.24 X-Migadu-Scanner: scn0.migadu.com X-TUID: OYquhXxvUCZo * gnu/services/dict.scm (dicod-shepherd-service): Use 'make-inetd-constructor' in the 'start' method when available. --- gnu/services/dict.scm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm index 62b21f8d53..109917c05c 100644 --- a/gnu/services/dict.scm +++ b/gnu/services/dict.scm @@ -146,6 +146,7 @@ (define %dicod-activation (define (dicod-shepherd-service config) (let* ((dicod.conf (dicod-configuration-file config)) + (interfaces (dicod-configuration-interfaces config)) (dicod (least-authority-wrapper (file-append (dicod-configuration-dico config) "/bin/dicod") @@ -165,10 +166,19 @@ (define (dicod-shepherd-service config) (provision '(dicod)) (requirement '(user-processes)) (documentation "Run the dicod daemon.") - (start #~(make-forkexec-constructor - (list #$dicod "--foreground" - (string-append "--config=" #$dicod.conf)) - #:user "dicod" #:group "dicod")) + (start #~(if (and (defined? 'make-inetd-constructor) + #$(= 1 (length interfaces))) ;XXX + (make-inetd-constructor + (list #$dicod "--inetd" "--foreground" + (string-append "--config=" #$dicod.conf)) + (addrinfo:addr + (car (getaddrinfo #$(first interfaces) "dict"))) + #:user "dicod" #:group "dicod" + #:service-name-stem "dicod") + (make-forkexec-constructor + (list #$dicod "--foreground" + (string-append "--config=" #$dicod.conf)) + #:user "dicod" #:group "dicod"))) (stop #~(make-kill-destructor)))))) (define dicod-service-type -- 2.35.1