热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Supportforkillingthewholechildprocessgroup

tinionlykillstheimmediatechildprocess.Thismeansthatifyoudo,forexample,

tini only kills the immediate child process. This means that if you
do, for example,

1
docker run krallin/ubuntu-tini sh -c 'sleep 10'

and ctrl-C it, nothing happens: SIGINT is sent to the 'sh' process,
but that shell won't react to it while it is waiting for the 'sleep'
to finish.

This change adds a -g option to put the child process of tini into a
new process group, and sends signals to that group, so that every
process in the group gets a signal. This corresponds more closely to
what happens when you do ctrl-C etc. in a terminal: The signal is sent
to the foreground process group.

So if you try the example above with a container image that passes -g
to tini, the SIGINT will be received by the 'sleep', and the container
promptly exits.

该提问来源于开源项目:krallin/tini

I apologize if I made you feel like I felt this flag was useless / your use case wasn't valid for Tini. I should have made it clearer that I was just asking for your input (since you have the use case for the -g flag).



No problem, I'm sorry that I misinterpreted you.

I tried the fix-19-pass-tty branch. I'll add a comment to the pull request.





   



推荐阅读
author-avatar
鸵鸟家的大pp
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有