On Tuesday, June 4, 2019 9:33:33 AM CEST Miroslav Suchý wrote:
Dne 03. 06. 19 v 13:00 Kamil Dudka napsal(a):
>> Now I'm working on signal SIGTERM handling and I would like to kill all
>> processes related to the main mock process.
>>
>> What do you think is it a good
>>
>> idea to kill all processes, or do we want to kill the main process only?
>> And what about SIGINT so-called KeyInterrupt in python? Same reaction?
>
> Your question is missing some context. Are you trying to improve signal
> handling in your own code that uses mock, or are you trying to improve
> signal handling in the implementation of mock itself?
I will try to clarify this.
In past, when you send SIGKILL to Mock, then only Mock terminated. It leaves
behind any running rpmbuild or dnf.
Jan is working on fix for this use
case:
https://github.com/rpm-software-management/mock/issues/153
As part of this work, we asked ourself the question: should mock clean up
after itself when exiting?
I think it should. But you will need to handle SIGTERM instead of SIGKILL.
But I wonder what should be correct/expected behaviour? E.g., is
someone
running daemons in mock using 'chroot' or
'shell' command and would be
surprised if Mock will kill it when Mock will terminate?
Not that I know of.
Or we can assume
that when Mock terminate then nothing should be running in the chroot?
Yes please.
What are your use-cases?
csmock uses it for fully automated static analysis of RPM packages.
Kamil