GNU bug report logs -
#61803
[PATCH 0/3] [shepherd] improve race-free spawn+wait
Previous Next
Reported by: Ulf Herrman <striness <at> tilde.club>
Date: Sun, 26 Feb 2023 08:32:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 61803 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:
>> From 177592ee9d4b7fc6dcc80e545e8ad615a1d6786c Mon Sep 17 00:00:00 2001
>> From: ulfvonbelow <striness <at> tilde.club>
>> Date: Sat, 25 Feb 2023 00:56:57 -0600
>> Subject: [PATCH 3/3] service: add spawn-shell-command replacement for
>> `system'.
>>
>> We already have a replacement for `system*' that avoids racing, but not for
>> `system'.
>>
>> * configure.ac (SHELL): new substitution variable.
>> * modules/shepherd/system.scm.in (%shell-filename): new variable.
>> * modules/shepherd/service.scm
>> (spawn-shell-command, real-system): new procedures.
>> * modules/shepherd.scm (main): replace `system' with `spawn-shell-command'.
> Out of curiosity, do you have a need for ‘system’?
I don't.
> I’m inclined to recommend against its use, in which case this patch is
> unnecessary.
I tend to agree, but make-system-constructor and make-system-destructor
both use it and are documented in the manual, so we should either make
them work properly or remove them.
>> +(define %shell-filename "@SHELL@")
>
> This is the configure-time shell so it will be wrong when
> cross-compiling.
>
> I’d just do:
>
> (define %shell (or (getenv "SHELL") "/bin/sh"))
>
The rationale behind not taking that straightforward approach was to
closely emulate the normal behavior of 'system' on guix, where the shell
path used is a hardcoded store path, though since guix's libc is likely
the only one where this is anything other than /bin/sh, I suppose it
does make a lot more sense to patch it in the guix package definition
(or accept the minor behavioral difference) than to try to automagically
figure it out at configure-time, which also has the problems you
mentioned.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 2 years and 73 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.