GNU bug report logs - #60106
[Shepherd 0.9.3] ‘system*’ replacement cannot be passed environment variables

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Severity: important; Reported by: Ludovic Courtès <ludovic.courtes@HIDDEN>; dated Thu, 15 Dec 2022 22:48:02 UTC; Maintainer for guix is bug-guix@HIDDEN.
Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 60106 <at> debbugs.gnu.org:


Received: (at 60106) by debbugs.gnu.org; 22 Dec 2022 16:47:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 22 11:47:46 2022
Received: from localhost ([127.0.0.1]:36074 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p8OjS-0000ij-5y
	for submit <at> 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 <ludovic.courtes@HIDDEN>) id 1p8OjQ-0000id-2i
 for 60106 <at> 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@HIDDEN;
 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: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludovic.courtes@HIDDEN>
To: Adam Faiz <adam.faiz@HIDDEN>
Subject: Re: [Shepherd 0.9.3] =?utf-8?B?4oCYc3lzdGVtKuKAmQ==?= replacement
 cannot be passed environment variables
References: <7bff0337-5bfd-22d9-8cc2-b7912eef0f66@HIDDEN>
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=2C?= 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@HIDDEN> (Adam Faiz's
 message of "Thu, 22 Dec 2022 16:17:59 +0000")
Message-ID: <87k02j1j2u.fsf@HIDDEN>
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-Debbugs-Envelope-To: 60106
Cc: 60106 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Adam Faiz <adam.faiz@HIDDEN> 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.




Information forwarded to bug-guix@HIDDEN:
bug#60106; Package guix. Full text available.

Message received at 60106 <at> debbugs.gnu.org:


Received: (at 60106) by debbugs.gnu.org; 22 Dec 2022 16:18:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 22 11:18:15 2022
Received: from localhost ([127.0.0.1]:35926 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p8OGs-0000HK-SC
	for submit <at> 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 <adam.faiz@HIDDEN>) id 1p8OGo-0000Gr-9K
 for 60106 <at> 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@HIDDEN>
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
To: 60106 <at> debbugs.gnu.org
Subject: =?UTF-8?B?W1NoZXBoZXJkIDAuOS4zXSDigJhzeXN0ZW0q4oCZIHJlcGxhY2VtZW50?=
 =?UTF-8?Q?_cannot_be_passed_environment_variables?=
Content-Language: en-US
From: Adam Faiz <adam.faiz@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60106
Cc: ludovic.courtes@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Information forwarded to bug-guix@HIDDEN:
bug#60106; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Dec 2022 22:47:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 15 17:47:32 2022
Received: from localhost ([127.0.0.1]:45373 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p5x0l-0004oB-PF
	for submit <at> 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 <ludovic.courtes@HIDDEN>) id 1p5x0i-0004o1-8G
 for submit <at> 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 <ludovic.courtes@HIDDEN>)
 id 1p5x0f-0005IW-60
 for bug-guix@HIDDEN; 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 <ludovic.courtes@HIDDEN>)
 id 1p5x0b-0001Ld-Q7
 for bug-guix@HIDDEN; 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@HIDDEN;
 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?= <ludovic.courtes@HIDDEN>
To: bug-guix@HIDDEN
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@HIDDEN>
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@HIDDEN;
 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 <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

As we found out while debugging <https://issues.guix.gnu.org/60010>, 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.




Acknowledgement sent to Ludovic Courtès <ludovic.courtes@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#60106; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 17 Jan 2023 15:30:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.