[LTP] [PATCH v2] lib: shell: Fix timeout process races

Li Wang liwang@redhat.com
Wed Sep 22 11:39:38 CEST 2021


On Wed, Sep 22, 2021 at 5:31 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > > > Agreed, that sounds like a great method.
> > >
> > > Should I send v3 or can I commit v2 with this change?
> > >
> >
> > V3 please, I will help test it all.
>
> Ok, will send ASAP.
>
Thanks.


>
> > I just think of setsid(), is that works and better than setpgid(0, 0)?
>
> For moving the process out of the process group setpgid() is enough, we
> use it in the lib/tst_test.c for the fork_testrun() in order to track
> all children of the test process as well.
>
> I do not think that we need a new session here, that would probably have
> strange side effects, for instance it would isolate the tst_timeout_kill
> process from the terminal the tests were started in.
>

Ok, thanks! Let's go with the safe method setpgid(0, 0).

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210922/9225da01/attachment.htm>


More information about the ltp mailing list