TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Linux Tip: Don't use kill -9

1 点作者 chankey_pathak超过 11 年前
No no no. Don&#x27;t use kill -9.<p>It doesn&#x27;t give the process a chance to cleanly:<p>1) shut down socket connections<p>2) clean up temp files<p>3) inform its children that it is going away<p>4) reset its terminal characteristics<p>and so on and so on and so on.<p>Generally, send 15, and wait a second or two, and if that doesn&#x27;t work, send 2, and if that doesn&#x27;t work, send 1. If that doesn&#x27;t, REMOVE THE BINARY because the program is badly behaved!<p>Don&#x27;t use kill -9. Don&#x27;t bring out the combine harvester just to tidy up the flower pot.<p>Credit: Randal L. Schwartz<p>Source: http:&#x2F;&#x2F;partmaps.org&#x2F;era&#x2F;unix&#x2F;award.html#uuk9letter

1 comment

jlgaddis超过 11 年前
As mentioned, SIGTERM can be caught and gives the process a chance to clean up. SIGKILL, the nuclear option, cannot be blocked.<p>Related: Solaris tip for Linux admins: <i>killall</i> does exactly what it says and not what you think.