From unknown Fri Jun 20 20:10:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60106: [Shepherd 0.9.3] =?UTF-8?Q?=E2=80=98system*=E2=80=99?= replacement cannot be passed environment variables Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 15 Dec 2022 22:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60106 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 60106@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167114445218493 (code B ref -1); Thu, 15 Dec 2022 22:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Dec 2022 22:47:32 +0000 Received: from localhost ([127.0.0.1]:45373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5x0l-0004oB-PF for submit@debbugs.gnu.org; Thu, 15 Dec 2022 17:47:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:58646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5x0i-0004o1-8G for submit@debbugs.gnu.org; Thu, 15 Dec 2022 17:47:30 -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 1p5x0f-0005IW-60 for bug-guix@gnu.org; Thu, 15 Dec 2022 17:47:28 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5x0b-0001Ld-Q7 for bug-guix@gnu.org; Thu, 15 Dec 2022 17:47:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=CyqfCTA1RwJJKuHIUhkF2KmdCA17/xprZjyWwO/whmw=; b=Xtf1Cv4jzIZTwXN1VxFFC5mvLsxHnTOQXn+KmON+5GmWrvgFfLEYmJRn cc8B4rVvuUWqd1HJpCeV69lCN4z7x0dVMI2ydZFfFEDz1qMNW7idR3djH FIHvVrxJveaRAMKdYYvpl9fNzN+YY2+nBw/1LWwLAfGypakeSgfD/q3+h c=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludovic.courtes@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,248,1665439200"; d="scan'208";a="42796942" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2022 23:47:17 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 25 Frimaire an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Grillon X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 15 Dec 2022 23:47:15 +0100 Message-ID: <87pmckl1xo.fsf@inria.fr> 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 Received-SPF: pass client-ip=192.134.164.104; envelope-from=ludovic.courtes@inria.fr; helo=mail3-relais-sop.national.inria.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) As we found out while debugging , the Shepherd 0.9.3, with its =E2=80=98system*=E2=80=99 replacement (aka. =E2=80= =98spawn-command=E2=80=99), makes it very hard to spawn a command with different environment variables. The following options don=E2=80=99t work: =E2=80=A2 Changing shepherd=E2=80=99s own environment variables with =E2= =80=98setenv=E2=80=99 for instance: =E2=80=98spawn-command=E2=80=99 calls =E2=80=98fork+exec-comm= and=E2=80=99, whose default #:environment-variables is provided by the =E2=80=98default-environment-variables=E2=80=99 parameter, which gets i= ts default value at when shepherd starts. There=E2=80=99s no environment variable inheritance, contrary to the real =E2=80=98system*=E2=80=99. =E2=80=A2 Parameterizing =E2=80=98default-environment-variables=E2=80=99: (parameterize ((default-environment-variables =E2=80=A6)) (system* =E2=80=A6)) That won=E2=80=99t work because =E2=80=98spawn-command=E2=80=99 delegat= es to the process monitoring fiber, which has a different dynamic state and thus doesn=E2=80=99t see this change. =E2=80=A2 Even a plain (set! default-environment-variables =E2=80=A6) won= =E2=80=99t work, probably due to inlining within (shepherd services). I think we=E2=80=99ll have to add a parameter to =E2=80=98spawn-command=E2= =80=99 to specify environment variables. Ludo=E2=80=99. From unknown Fri Jun 20 20:10:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60106: [Shepherd 0.9.3] =?UTF-8?Q?=E2=80=98system*=E2=80=99?= replacement cannot be passed environment variables References: <87pmckl1xo.fsf@inria.fr> In-Reply-To: <87pmckl1xo.fsf@inria.fr> Resent-From: Adam Faiz Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 22 Dec 2022 16:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60106 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 60106@debbugs.gnu.org Cc: ludovic.courtes@inria.fr Received: via spool by 60106-submit@debbugs.gnu.org id=B60106.16717258951078 (code B ref 60106); Thu, 22 Dec 2022 16:19:01 +0000 Received: (at 60106) by debbugs.gnu.org; 22 Dec 2022 16:18:15 +0000 Received: from localhost ([127.0.0.1]:35926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8OGs-0000HK-SC for submit@debbugs.gnu.org; Thu, 22 Dec 2022 11:18:15 -0500 Received: from knopi.disroot.org ([178.21.23.139]:53474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8OGo-0000Gr-9K for 60106@debbugs.gnu.org; Thu, 22 Dec 2022 11:18:11 -0500 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 8632340F25; Thu, 22 Dec 2022 17:18:08 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r66vSGWVXhlv; Thu, 22 Dec 2022 17:18:07 +0100 (CET) Message-ID: <7bff0337-5bfd-22d9-8cc2-b7912eef0f66@disroot.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1671725887; bh=e9QYmWo8crXOkI1yEv9oQkI2dZBWbDkI5gECWpcKumQ=; h=Date:To:Subject:From:Cc; b=SAKq1/RNtR9fj0NUspbPEnTyTGIZA/XSLtcb4VVItPy/izfRsBtWUjxjTI2Nao+Xa 7lm9OPLC3JILJEv9wQp3AuuYQY24RwTJsNTW+Sj63lHkIoFD/P6jnCNY6fluRJdHN3 WssnN0d1heOug3mrqAwSHieFtfGda3Df8XNdxxRIGZg8FpqRnmmqQc1Dk6POIVdA+X ZwRbbmx1UNfQ6fwmHgKWDTp2ksDcjL8vUZtNIaZRgTGVQhTfCSX9kxl8wjI4h5Zaer +0l4QIpGLLENNVl5Jwfq+d+k0pKLQ4WvFH6Nxw90+fvtlnH+4UpIpBcfNBZVX9MRwP sOGsx8LoA7Lcw== Date: Thu, 22 Dec 2022 16:17:59 +0000 MIME-Version: 1.0 Content-Language: en-US From: Adam Faiz Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) 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 (-) > I think we’ll have to add a parameter to ‘spawn-command’ to specify > environment variables. > > Ludo’. If you do this, can you add an #:append? flag which adds environment variables to the inherited environment instead of specifying the variables declaratively? It can be #f by default. It would be very useful for me using the shepherd as init on a foreign distro, so I don't have to use the `env` command. From unknown Fri Jun 20 20:10:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60106: [Shepherd 0.9.3] =?UTF-8?Q?=E2=80=98system*=E2=80=99?= replacement cannot be passed environment variables Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 22 Dec 2022 16:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60106 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Adam Faiz Cc: 60106@debbugs.gnu.org Received: via spool by 60106-submit@debbugs.gnu.org id=B60106.16717276662777 (code B ref 60106); Thu, 22 Dec 2022 16:48:01 +0000 Received: (at 60106) by debbugs.gnu.org; 22 Dec 2022 16:47:46 +0000 Received: from localhost ([127.0.0.1]:36074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8OjS-0000ij-5y for submit@debbugs.gnu.org; Thu, 22 Dec 2022 11:47:46 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:59542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8OjQ-0000id-2i for 60106@debbugs.gnu.org; Thu, 22 Dec 2022 11:47:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version:content-transfer-encoding; bh=Dj8gyjWhB8sdtUbO8exSloe47q+HnC4E/iY0vc+lbGw=; b=Yx1TSS0KXbUNTo6m7b+cjoWWA0U+8pIZpUzwRmNXt5dlIgweEIpPOkgo YSnFJ0hALn0xL//+AT839gJowfASsuVfoIh14XDttHG0/Nz4/FU9YJcFK eU2IcONL5NYm1VIHgqs/5D0DjdJpZqHCzW/hemw5CoTmHwcXgEzU9vKbi k=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludovic.courtes@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,265,1665439200"; d="scan'208";a="84715310" Received: from unknown (HELO ribbon) ([193.50.110.60]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 17:47:37 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <7bff0337-5bfd-22d9-8cc2-b7912eef0f66@disroot.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 2 =?UTF-8?Q?Niv=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Houille X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 22 Dec 2022 17:47:37 +0100 In-Reply-To: <7bff0337-5bfd-22d9-8cc2-b7912eef0f66@disroot.org> (Adam Faiz's message of "Thu, 22 Dec 2022 16:17:59 +0000") Message-ID: <87k02j1j2u.fsf@inria.fr> 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.7 (/) 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.7 (-) Adam Faiz skribis: >> I think we=E2=80=99ll have to add a parameter to =E2=80=98spawn-command= =E2=80=99 to specify >> environment variables. >> Ludo=E2=80=99. > If you do this, can you add an #:append? flag which adds environment > variables to the inherited environment instead of specifying the > variables declaratively? It can be #f by default. > > It would be very useful for me using the shepherd as init on a foreign > distro, so I don't have to use the `env` command. You could always write something like: #:environment-variables `("EXTRA_VARIABLE=3Dsomething" ,@(environ)) to append =E2=80=98EXTRA_VARIABLE=E2=80=99 to those of the environment. So I don=E2=80=99t think we need #:append. Thanks for your feedback, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 17 10:21:18 2023 Received: (at control) by debbugs.gnu.org; 17 Jan 2023 15:21:18 +0000 Received: from localhost ([127.0.0.1]:37964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHnm1-0002s5-UH for submit@debbugs.gnu.org; Tue, 17 Jan 2023 10:21:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHnm0-0002rl-Fv for control@debbugs.gnu.org; Tue, 17 Jan 2023 10:21:16 -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 1pHnlv-0003TD-7A for control@debbugs.gnu.org; Tue, 17 Jan 2023 10:21:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=BFMbNKU1kAIbMgywlO3Q6tNNqkdamj5wryVHq/KgyIY=; b=EsumxGDtUIJrTf dOHj/JSxMsx29J/kI5xkO7y4qDGZNOlLaS6A69EYfsML59o1x/SibMlsQ2DWYakx5i0FoLn+Zu336 mY7NojR7mgY9iIjwHpTDRzr0WN1Uy2ioiGyaBNfeyIbtaSw/QG3PUi5Nbjh24b09fnicua0Ga0zId 6Xbmvqgs9ElIQv/EByTIbMMEEAqgLvAhpnHIjbVjHi8GyTyqla9lu4niXk3LviTeZhT7KKNm05PKu kPOs8f4bOsxKLm+44hdrN1Ma7L7wjIEuejOZZ1+0kSIQWEolajRTYVcUa9r6e9k2H9hXCZSi8N1m8 t3oNAUtJDPI2K4Fs/IWQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHnlt-0005FG-Ur for control@debbugs.gnu.org; Tue, 17 Jan 2023 10:21:10 -0500 Date: Tue, 17 Jan 2023 16:21:05 +0100 Message-Id: <87lem1faqm.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #60106 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) severity 60106 important quit From unknown Fri Jun 20 20:10:36 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#60106: closed (Re: bug#61803: [PATCH 0/3] [shepherd] improve race-free spawn+wait) Message-ID: References: <877cvwp3rm.fsf@gnu.org> <87pmckl1xo.fsf@inria.fr> X-Gnu-PR-Message: they-closed 60106 X-Gnu-PR-Package: guix Reply-To: 60106@debbugs.gnu.org Date: Sat, 04 Mar 2023 22:11:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1677967862-25704-1" This is a multi-part message in MIME format... ------------=_1677967862-25704-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #60106: [Shepherd 0.9.3] =E2=80=98system*=E2=80=99 replacement cannot be pa= ssed environment variables which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 60106@debbugs.gnu.org. --=20 60106: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D60106 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1677967862-25704-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 60106-done) by debbugs.gnu.org; 4 Mar 2023 22:10:04 +0000 Received: from localhost ([127.0.0.1]:37948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYa4p-0006eq-Vi for submit@debbugs.gnu.org; Sat, 04 Mar 2023 17:10:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYa4o-0006eG-C4; Sat, 04 Mar 2023 17:10:02 -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 1pYa4e-0001l9-7v; Sat, 04 Mar 2023 17:09:52 -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=4qdMlE4qaKwBZuVVTqyIbpfQWN5SXC9h/CQycZ7SvH0=; b=DuAjp2XEyQYftZSDxv2O t3/i6pHoxKrBaOtKtbMdJwDI3g1WcZJ+aItQKqjDINuglcQSk1TF3CMvS+yE4aRtBCTrluU/Nh4ZE 90tQOcjWpfLVD0oEnNZFSe7tNwHUXc+ou7JZ9ErAosLHjuvlNSzpA+yZ725DbRe3dfwWtcfszqrgJ t5sdgz1WLqX8NRiFLuh6S7lADW2Ky+iCRwcq68NGWpwBJ8GZU5DE2eS0kKcU7e7Qai5wc36PeTZC9 Xosk7xwo6rBBRlCbBn9ifo6gCW1n4kfA4MFjDr7SQe79Jn38l7TVRe/g7/+xtA95W3QqtuPousMVZ qxcOn00mNAIw/w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYa4d-0001Mh-Oh; Sat, 04 Mar 2023 17:09:51 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ulf Herrman Subject: Re: bug#61803: [PATCH 0/3] [shepherd] improve race-free spawn+wait References: <87cz5x1jr2.fsf@tilde.club> Date: Sat, 04 Mar 2023 23:09:49 +0100 In-Reply-To: <87cz5x1jr2.fsf@tilde.club> (Ulf Herrman's message of "Sat, 25 Feb 2023 16:08:01 -0600") Message-ID: <877cvwp3rm.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: 60106-done Cc: 61803@debbugs.gnu.org, 60106-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 Ulf, Ulf Herrman skribis: > From 51ee63ace6f3f52eb196c990664cc6b9af3d3683 Mon Sep 17 00:00:00 2001 > From: ulfvonbelow > Date: Sat, 25 Feb 2023 00:46:27 -0600 > Subject: [PATCH 2/3] service: accept fork+exec-command argument list in > monitor. > > Sometimes it's necessary to run startup / shutdown programs as a certain = user, > in a certain directory, with certain environment variables, etc. Shepherd > currently provides a replacement for system* that won't race against the > child process auto-reaper, but this lacks the flexibility Shepherd users = are > used to. > > * modules/shepherd/service.scm (process-monitor): treat command instead as > argument list to fork+exec-command. > (spawn-via-monitor): update to new convention. > (fork+exec+wait-command): new procedure. On this one I took a similar approach but chose to extend =E2=80=98spawn-command=E2=80=99 instead of introducing a new procedure=E2= =80=94see commit 0f3276a9c3dafbef41b0aab88ba5dda1bb78dc99. Another difference is explicitly listing keyword arguments so that their default values are taken from the caller=E2=80=99s dynamic state and not fr= om that of the process monitoring fiber. This fixes . Let me know what you think! Thanks, Ludo=E2=80=99. ------------=_1677967862-25704-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Dec 2022 22:47:32 +0000 Received: from localhost ([127.0.0.1]:45373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5x0l-0004oB-PF for submit@debbugs.gnu.org; Thu, 15 Dec 2022 17:47:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:58646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5x0i-0004o1-8G for submit@debbugs.gnu.org; Thu, 15 Dec 2022 17:47:30 -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 1p5x0f-0005IW-60 for bug-guix@gnu.org; Thu, 15 Dec 2022 17:47:28 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5x0b-0001Ld-Q7 for bug-guix@gnu.org; Thu, 15 Dec 2022 17:47:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=CyqfCTA1RwJJKuHIUhkF2KmdCA17/xprZjyWwO/whmw=; b=Xtf1Cv4jzIZTwXN1VxFFC5mvLsxHnTOQXn+KmON+5GmWrvgFfLEYmJRn cc8B4rVvuUWqd1HJpCeV69lCN4z7x0dVMI2ydZFfFEDz1qMNW7idR3djH FIHvVrxJveaRAMKdYYvpl9fNzN+YY2+nBw/1LWwLAfGypakeSgfD/q3+h c=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludovic.courtes@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,248,1665439200"; d="scan'208";a="42796942" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2022 23:47:17 +0100 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org Subject: [Shepherd 0.9.3] =?utf-8?B?4oCYc3lzdGVtKuKAmQ==?= replacement cannot be passed environment variables X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 25 Frimaire an 231 de la =?utf-8?Q?R=C3=A9v?= =?utf-8?Q?olution=2C?= jour du Grillon X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 15 Dec 2022 23:47:15 +0100 Message-ID: <87pmckl1xo.fsf@inria.fr> 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 Received-SPF: pass client-ip=192.134.164.104; envelope-from=ludovic.courtes@inria.fr; helo=mail3-relais-sop.national.inria.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit 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: -2.3 (--) As we found out while debugging , the Shepherd 0.9.3, with its =E2=80=98system*=E2=80=99 replacement (aka. =E2=80= =98spawn-command=E2=80=99), makes it very hard to spawn a command with different environment variables. The following options don=E2=80=99t work: =E2=80=A2 Changing shepherd=E2=80=99s own environment variables with =E2= =80=98setenv=E2=80=99 for instance: =E2=80=98spawn-command=E2=80=99 calls =E2=80=98fork+exec-comm= and=E2=80=99, whose default #:environment-variables is provided by the =E2=80=98default-environment-variables=E2=80=99 parameter, which gets i= ts default value at when shepherd starts. There=E2=80=99s no environment variable inheritance, contrary to the real =E2=80=98system*=E2=80=99. =E2=80=A2 Parameterizing =E2=80=98default-environment-variables=E2=80=99: (parameterize ((default-environment-variables =E2=80=A6)) (system* =E2=80=A6)) That won=E2=80=99t work because =E2=80=98spawn-command=E2=80=99 delegat= es to the process monitoring fiber, which has a different dynamic state and thus doesn=E2=80=99t see this change. =E2=80=A2 Even a plain (set! default-environment-variables =E2=80=A6) won= =E2=80=99t work, probably due to inlining within (shepherd services). I think we=E2=80=99ll have to add a parameter to =E2=80=98spawn-command=E2= =80=99 to specify environment variables. Ludo=E2=80=99. ------------=_1677967862-25704-1--