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

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Date: Thu, 15 Dec 2022 22:48:02 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: 60106 <at> 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
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’.




This bug report was last modified 2 years and 77 days ago.

Previous Next


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