[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7dq4FUbEHe7QQg7@LQ3V64L9R2>
Date: Thu, 20 Feb 2025 12:48:16 -0500
From: Joe Damato <jdamato@...tly.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, andrew+netdev@...n.ch, horms@...nel.org,
stfomichev@...il.com, petrm@...dia.com
Subject: Re: [PATCH net-next v2 1/7] selftests: drv-net: add a warning for
bkg + shell + terminate
On Wed, Feb 19, 2025 at 03:49:50PM -0800, Jakub Kicinski wrote:
> Joe Damato reports that some shells will fork before running
> the command when python does "sh -c $cmd", while bash does
> an exec of $cmd directly.
I'm not sure what's going on, but as I mentioned in the other thread
and below, I am using bash as well.
> This will have implications for our
> ability to terminate the child process on bash vs other shells.
> Warn about using
>
> bkg(... shell=True, termininate=True)
>
> most background commands can hopefully exit cleanly (exit_wait).
>
> Link: https://lore.kernel.org/Z7Yld21sv_Ip3gQx@LQ3V64L9R2
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> v2: new
> ---
> tools/testing/selftests/net/lib/py/utils.py | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py
> index 9e3bcddcf3e8..33b153767d89 100644
> --- a/tools/testing/selftests/net/lib/py/utils.py
> +++ b/tools/testing/selftests/net/lib/py/utils.py
> @@ -61,6 +61,10 @@ import time
> self.terminate = not exit_wait
> self.check_fail = fail
>
> + if shell and self.terminate:
> + print("# Warning: combining shell and terminate is risky!")
> + print("# SIGTERM may not reach the child on zsh/ksh!")
I'm not opposed to putting a warning here, but just as a disclaimer
and for anyone else following along -- I am using bash:
$ echo $SHELL
/bin/bash
$ bash --version
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
Powered by blists - more mailing lists