From: "Ludovic Courtès" <ludovic.courtes@inria.fr>
To: 60106@debbugs.gnu.org
Subject: bug#60106: [Shepherd 0.9.3] ‘system*’ replacement cannot be passed environment variables
Date: Thu, 15 Dec 2022 23:47:15 +0100 [thread overview]
Message-ID: <87pmckl1xo.fsf@inria.fr> (raw)
As we found out while debugging <https://issues.guix.gnu.org/60010>, the
Shepherd 0.9.3, with its ‘system*’ replacement (aka. ‘spawn-command’),
makes it very hard to spawn a command with different environment
variables.
The following options don’t work:
• Changing shepherd’s own environment variables with ‘setenv’ for
instance: ‘spawn-command’ calls ‘fork+exec-command’, whose default
#:environment-variables is provided by the
‘default-environment-variables’ parameter, which gets its default
value at when shepherd starts. There’s no environment variable
inheritance, contrary to the real ‘system*’.
• Parameterizing ‘default-environment-variables’:
(parameterize ((default-environment-variables …))
(system* …))
That won’t work because ‘spawn-command’ delegates to the process
monitoring fiber, which has a different dynamic state and thus
doesn’t see this change.
• Even a plain (set! default-environment-variables …) won’t work,
probably due to inlining within (shepherd services).
I think we’ll have to add a parameter to ‘spawn-command’ to specify
environment variables.
Ludo’.
next reply other threads:[~2022-12-15 22:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 22:47 Ludovic Courtès [this message]
2022-12-22 16:17 ` bug#60106: [Shepherd 0.9.3] ‘system*’ replacement cannot be passed environment variables Adam Faiz via Bug reports for GNU Guix
2022-12-22 16:47 ` 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=87pmckl1xo.fsf@inria.fr \
--to=ludovic.courtes@inria.fr \
--cc=60106@debbugs.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).