From: Ulf Herrman <striness@tilde.club>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 61803@debbugs.gnu.org, Ulf Herrman <striness@tilde.club>
Subject: [bug#61803] [PATCH 0/3] [shepherd] improve race-free spawn+wait
Date: Wed, 08 Mar 2023 21:48:54 -0600 [thread overview]
Message-ID: <878rg61t5l.fsf@tilde.club> (raw)
In-Reply-To: <87h6v23ike.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 02 Mar 2023 23:16:33 +0100")
[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]
Ludovic Courtès <ludo@gnu.org> writes:
>> From 177592ee9d4b7fc6dcc80e545e8ad615a1d6786c Mon Sep 17 00:00:00 2001
>> From: ulfvonbelow <striness@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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]
next prev parent reply other threads:[~2023-03-09 4:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-25 22:08 [bug#61803] [PATCH 0/3] [shepherd] improve race-free spawn+wait Ulf Herrman
2023-02-26 14:17 ` Tobias Geerinckx-Rice via Guix-patches via
2023-03-02 22:16 ` Ludovic Courtès
2023-03-09 3:48 ` Ulf Herrman [this message]
2023-03-11 14:57 ` Ludovic Courtès
2023-03-04 22:09 ` 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=878rg61t5l.fsf@tilde.club \
--to=striness@tilde.club \
--cc=61803@debbugs.gnu.org \
--cc=ludo@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).