From: Joerg Vehlow <lkml@jv-coder.de>
To: ltp@lists.linux.it
Subject: [LTP] [RFC] Shell API timeout sleep orphan processes
Date: Tue, 4 May 2021 12:35:48 +0200 [thread overview]
Message-ID: <651cb158-c640-e0b5-a2f2-4b77efcfa288@jv-coder.de> (raw)
In-Reply-To: <YJEKFLmcKvnHvlIV@pevik>
Hi Petr,
>>>> The only way to fix this really portable I can think of is moving the
>>>> timeout code (including the logic in _tst_kill_test) into c code. This way
>>>> there would only be one binary, that can be killed flawlessly.
>>> Maybe set -m would be enough. But sure, rewriting C is usually the best approach
>>> for shell problems, we use quite a lot of C helpers for shell already.
>> I will send the patch, if this introduces any new issues, we can still
>> switch to a c based implementation.
> Thank you!
I guess I will not submit the fix with set -m...
My colleague working testing on a new target just ran into a problem
with out fix using set -m.
For busybox sh, it only works, if a tty is allocated, otherwise it
refuses to enable job monitor mode and the whole construct fails...
Since using the monitor mode only exploits the side effect, that it
creates a process group and we already found a first issue, I think the
only solution is switching to a c-based solution for the timeout stuff.
Personally I like that it is written in shell script, but I see no other
option to do it in pure shell. There is no builtin way, to create a
process group and just redirecting the output of sleep to null does not
seem to be a very good solution to me, because there would still be a
lot of orphans around.
J?rg
next prev parent reply other threads:[~2021-05-04 10:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 11:08 [LTP] [RFC] Shell API timeout sleep orphan processes Joerg Vehlow
2021-05-04 6:52 ` Petr Vorel
2021-05-04 8:04 ` Joerg Vehlow
2021-05-04 8:47 ` Petr Vorel
2021-05-04 10:35 ` Joerg Vehlow [this message]
2021-05-04 15:07 ` Petr Vorel
2021-05-06 12:23 ` Li Wang
2021-05-07 4:48 ` Joerg Vehlow
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=651cb158-c640-e0b5-a2f2-4b77efcfa288@jv-coder.de \
--to=lkml@jv-coder.de \
--cc=ltp@lists.linux.it \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox