{"id":157,"date":"2023-05-27T13:14:40","date_gmt":"2023-05-27T05:14:40","guid":{"rendered":"https:\/\/www.dataz8.com\/?p=157"},"modified":"2023-06-05T10:18:53","modified_gmt":"2023-06-05T02:18:53","slug":"kill%e5%91%bd%e4%bb%a4%e7%94%a8%e6%b3%95%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.dataz8.com\/?p=157","title":{"rendered":"kill\u547d\u4ee4\u7528\u6cd5\u8be6\u89e3"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>\u529f\u80fd\u8bf4\u660e<\/strong>\uff1a\u5220\u9664\u6267\u884c\u4e2d\u7684\u7a0b\u5e8f\u6216\u5de5\u4f5c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8bed\u6cd5<\/strong>\uff1akill&nbsp;[-s&nbsp;&lt;\u4fe1\u606f\u540d\u79f0\u6216\u7f16\u53f7&gt;][\u7a0b\u5e8f]\u3000\u6216\u3000kill&nbsp;[-l&nbsp;&lt;\u4fe1\u606f\u7f16\u53f7&gt;]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8865\u5145\u8bf4\u660e<\/strong>\uff1akill\u53ef\u5c06\u6307\u5b9a\u7684\u4fe1\u606f\u9001\u81f3\u7a0b\u5e8f\uff0c\u9884\u8bbe\u7684\u4fe1\u606f\u4e3aSIGTERM(15)\uff0c\u53ef\u6307\u5b9a\u7a0b\u5e8f\u7ec8\u6b62\u3002\u82e5\u4ecd\u65e0\u6cd5\u7ec8\u6b62\u8be5\u7a0b\u5e8f\uff0c\u53ef\u4f7f\u7528SIGKILL(9)\u4fe1\u606f\u5c1d\u8bd5\u5f3a\u5236\u5220\u9664\u7a0b\u5e8f\u3002\u7a0b\u5e8f\u6216\u5de5\u4f5c\u7684\u7f16\u53f7\u53ef\u7528ps\u6307\u4ee4\u6216jobs\u6307\u4ee4\u67e5\u770b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u53c2\u6570<\/strong>\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-l&nbsp;&lt;\u4fe1\u606f\u7f16\u53f7&gt;&nbsp;\u3000\u82e5\u4e0d\u52a0&lt;\u4fe1\u606f\u7f16\u53f7&gt;\u9009\u9879\uff0c\u5219-l\u53c2\u6570\u4f1a\u5217\u51fa\u5168\u90e8\u7684\u4fe1\u606f\u540d\u79f0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-s&nbsp;&lt;\u4fe1\u606f\u540d\u79f0\u6216\u7f16\u53f7&gt;&nbsp;\u3000\u6307\u5b9a\u8981\u9001\u51fa\u7684\u4fe1\u606f\u3002&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[\u7a0b\u5e8f]&nbsp;\u3000[\u7a0b\u5e8f]\u53ef\u4ee5\u662f\u7a0b\u5e8f\u7684PID\u6216\u662fPGID\uff0c\u4e5f\u53ef\u4ee5\u662f\u5de5\u4f5c\u7f16\u53f7\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.dataz8.com\/?p=157\/#1_%E4%BD%9C%E7%94%A8\" >1. \u4f5c\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.dataz8.com\/?p=157\/#2_%E6%A0%BC%E5%BC%8F\" >2. \u683c\u5f0f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.dataz8.com\/?p=157\/#3_%E5%8F%82%E6%95%B0\" >3. \u53c2\u6570<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.dataz8.com\/?p=157\/#4_%E8%AF%B4%E6%98%8E\" >4. \u8bf4\u660e<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_%E4%BD%9C%E7%94%A8\"><\/span>1. \u4f5c\u7528<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">kill\u547d\u4ee4\u7528\u6765\u4e2d\u6b62\u4e00\u4e2a\u8fdb\u7a0b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_%E6%A0%BC%E5%BC%8F\"><\/span>2. \u683c\u5f0f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">kill [ \uff0ds signal | \uff0dp ] [ \uff0da ] pid \u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">kill \uff0dl [ signal ]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_%E5%8F%82%E6%95%B0\"><\/span>3. \u53c2\u6570<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\uff0ds\uff1a\u6307\u5b9a\u53d1\u9001\u7684\u4fe1\u53f7\u3002<br>\uff0dp\uff1a\u6a21\u62df\u53d1\u9001\u4fe1\u53f7\u3002<br>\uff0dl\uff1a\u6307\u5b9a\u4fe1\u53f7\u7684\u540d\u79f0\u5217\u8868\u3002<br>pid\uff1a\u8981\u4e2d\u6b62\u8fdb\u7a0b\u7684ID\u53f7\u3002<br>signal\uff1a\u8868\u793a\u4fe1\u53f7\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_%E8%AF%B4%E6%98%8E\"><\/span>4. \u8bf4\u660e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fdb\u7a0b\u662fLinux\u7cfb\u7edf\u4e2d\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\u3002Linux\u662f\u4e00\u4e2a\u591a\u4efb\u52a1\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u7cfb\u7edf\u4e0a\u7ecf\u5e38\u540c\u65f6\u8fd0\u884c\u7740\u591a\u4e2a\u8fdb\u7a0b\u3002\u6211\u4eec\u6700\u591a\u5173\u5fc3\u7684\u662f\u5982\u4f55\u53bb\u63a7\u5236\u8fd9\u4e9b\u8fdb\u7a0b\uff0c\u8ba9\u5b83\u4eec\u80fd\u591f\u5f88\u597d\u5730\u4e3a\u7528\u6237\u670d\u52a1\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Linux\u64cd\u4f5c\u7cfb\u7edf\u5305\u62ec\u4e09\u79cd\u4e0d\u540c\u7c7b\u578b\u7684\u8fdb\u7a0b\u3002\u6bcf\u79cd\u8fdb\u7a0b\u90fd\u6709\u81ea\u5df1\u7684\u7279\u70b9\u548c\u5c5e\u6027\u3002\u4ea4\u4e92\u8fdb\u7a0b\u662f\u7531\u4e00\u4e2aShell\u542f\u52a8\u7684\u8fdb\u7a0b\u3002\u4ea4\u4e92\u8fdb\u7a0b\u65e2\u53ef\u4ee5\u5728\u524d\u53f0\u8fd0\u884c\uff0c\u4e5f\u53ef\u4ee5\u5728\u540e\u53f0\u8fd0\u884c\u3002\u6279\u5904\u7406\u8fdb\u7a0b\u548c\u7ec8\u7aef\u6ca1\u6709\u8054\u7cfb\uff0c\u662f\u4e00\u4e2a\u8fdb\u7a0b\u5e8f\u5217\u3002\u76d1\u63a7\u8fdb\u7a0b\uff08\u4e5f\u79f0\u7cfb\u7edf\u5b88\u62a4\u8fdb\u7a0b\uff09\u662fLinux\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u7684\u8fdb\u7a0b\uff0c\u5e76\u5728\u540e\u53f0\u8fd0\u884c\u3002\u4f8b\u5982\uff0chttpd\u662f\u8457\u540d\u7684Apache\u670d\u52a1\u5668\u7684\u76d1\u63a7\u8fdb\u7a0b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>kill\u547d\u4ee4\u7684\u5de5\u4f5c\u539f\u7406\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5411Linux\u7cfb\u7edf\u7684\u5185\u6838\u53d1\u9001\u4e00\u4e2a\u7cfb\u7edf\u64cd\u4f5c\u4fe1\u53f7\u548c\u67d0\u4e2a\u7a0b\u5e8f\u7684\u8fdb\u7a0b\u6807\u8bc6\u53f7\uff0c\u7136\u540e\u7cfb\u7edf\u5185\u6838\u5c31\u53ef\u4ee5\u5bf9\u8fdb\u7a0b\u6807\u8bc6\u53f7\u6307\u5b9a\u7684\u8fdb\u7a0b\u8fdb\u884c\u64cd\u4f5c\u3002\u6bd4\u5982\u5728top\u547d\u4ee4\u4e2d\uff0c\u6211\u4eec\u770b\u5230\u7cfb\u7edf\u8fd0\u884c\u4e86\u8bb8\u591a\u8fdb\u7a0b\uff0c\u6709\u4e8b\u5c31\u9700\u8981\u4f7f\u7528kill\u4e2d\u6b62\u67d0\u4e9b\u8fdb\u7a0b\u6765\u63d0\u9ad8\u7cfb\u7edf\u8d44\u6e90\u3002\u6bd4\u5982\uff0c\u7cfb\u7edf\u591a\u4e2a\u865a\u62df\u63a7\u5236\u53f0\u7684\u4f5c\u7528\uff0c\u662f\u5f53\u4e00\u4e2a\u7a0b\u5e8f\u51fa\u9519\u9020\u6210\u7cfb\u7edf\u6b7b\u9501\u65f6\uff0c\u53ef\u4ee5\u5207\u6362\u5230\u5176\u4ed6\u865a\u62df\u63a7\u5236\u53f0\u5de5\u4f5c\u5173\u95ed\u8fd9\u4e2a\u7a0b\u5e8f\uff0c\u6b64\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u5c31\u662fkill\uff0c\u56e0\u4e3akill\u662f\u5927\u591a\u6570Shell\u5185\u90e8\u547d\u4ee4\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>kill\u5e38\u89c1\u7684\u51e0\u4e2a\u4fe1\u53f7\u503c\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>\u4fe1\u53f7\u540d<\/strong><\/td><td><strong>\u4fe1\u53f7\u503c<\/strong><\/td><td><strong>\u884c\u4e3a<\/strong><\/td><\/tr><tr><td>SIGHUP<\/td><td>1<\/td><td>\u6302\u8d77\u67d0\u4e2a\u8fdb\u7a0b<\/td><\/tr><tr><td>SIGINT<\/td><td>2<\/td><td>\u4e2d\u65ad\u67d0\u4e2a\u8fdb\u7a0b<\/td><\/tr><tr><td>SIGKILL<\/td><td>9<\/td><td>\u6740\u6b7b\u67d0\u4e2a\u8fdb\u7a0b\uff0c\u4e0d\u505a\u4efb\u4f55\u6e05\u7406\u5de5\u4f5c\uff0c\u8be5\u4fe1\u53f7\u4e0d\u5141\u8bb8\u5ffd\u7565\u548c\u963b\u585e\uff0c\u6240\u4ee5\u5e94\u7528\u7a0b\u5e8f\u4f1a\u7acb\u523b\u7ec8\u6b62\u3002<\/td><\/tr><tr><td>SIGTERM<\/td><td>15<\/td><td>\u4f18\u96c5\u7ed3\u675f\u67d0\u4e2a\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u4f7f\u5f97\u8fdb\u7a0b\u5728\u9000\u51fa\u4e4b\u524d\u6e05\u7406\u5e76\u91ca\u653e\u8d44\u6e90\uff0c\u6bd4\u5982\u5c06\u7f13\u5b58\u56de\u5199\u3001\u7ed3\u675fsocket\u8fde\u63a5\uff0c\u5173\u95ed\u6253\u5f00\u7684\u6587\u4ef6\u7b49<\/td><\/tr><tr><td>SIGSTOP<\/td><td>17,19,23<\/td><td>\u505c\u6b62\u67d0\u4e2a\u8fdb\u7a0b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uff081\uff09\u5f3a\u884c\u4e2d\u6b62\uff08\u7ecf\u5e38\u4f7f\u7528\u6740\u6389\uff09\u4e00\u4e2a\u8fdb\u7a0b\u6807\u8bc6\u53f72123\u7684\u8fdb\u7a0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># kill -9 2123<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uff082\uff09\u89e3\u9664Linux\u7cfb\u7edf\u7684\u6b7b\u9501<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728Linux\u4e2d\u6709\u65f6\u4f1a\u53d1\u751f\u4e00\u79cd\u60c5\u51b5\uff1a\u4e00\u4e2a\u7a0b\u5e8f\u5d29\u6e83\uff0c\u5e76\u4e14\u5904\u4e8e\u6b7b\u9501\u7684\u72b6\u6001\u3002\u6b64\u65f6\u4e00\u822c\u4e0d\u7528\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a\uff0c\u53ea\u9700\u8981\u4e2d\u6b62\uff08\u6216\u8005\u8bf4\u662f\u5173\u95ed\uff09\u8fd9\u4e2a\u6709\u95ee\u9898\u7684\u7a0b\u5e8f\u5373\u53ef\u3002\u5f53kill\u5904\u4e8eX-Window\u754c\u9762\u65f6\uff0c\u4e3b\u8981\u7684\u7a0b\u5e8f\uff08\u9664\u4e86\u5d29\u6e83\u7684\u7a0b\u5e8f\u4e4b\u5916\uff09\u4e00\u822c\u90fd\u5df2\u7ecf\u6b63\u5e38\u542f\u52a8\u4e86\u3002\u6b64\u65f6\u6253\u5f00\u4e00\u4e2a\u7ec8\u7aef\uff0c\u5728\u90a3\u91cc\u4e2d\u6b62\u6709\u95ee\u9898\u7684\u7a0b\u5e8f\u3002\u6bd4\u5982\uff0c\u5982\u679cGoogle\u6d4f\u89c8\u5668\u7a0b\u5e8f\u51fa\u73b0\u4e86\u9501\u6b7b\u7684\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528kill\u547d\u4ee4\u6765\u4e2d\u6b62\u6240\u6709\u5305\u542bGoogle\u6d4f\u89c8\u5668\u7684\u7a0b\u5e8f\u3002\u9996\u5148\u7528top\u547d\u4ee4\u67e5\u51fa\u8be5\u7a0b\u5e8f\u7684PID\uff0c\u7136\u540e\u4f7f\u7528kill\u547d\u4ee4\u505c\u6b62\u8fd9\u4e2a\u7a0b\u5e8f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># kill -SIGKILL xxx<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u4e2d\uff0cxxx\u662f\u5305\u542b\u6709Google\u6d4f\u89c8\u5668\u7684\u7a0b\u5e8f\u7684\u8fdb\u7a0b\u6807\u8bc6\u53f7\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uff083\uff09killall\u547d\u4ee4<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Linux\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2akillall\u547d\u4ee4\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u8fdb\u7a0b\u7684\u540d\u5b57\u800c\u4e0d\u662f\u8fdb\u7a0b\u6807\u8bc6\u53f7\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># killall -HUP inetd<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u50f5\u5c38\u8fdb\u7a0b\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728Linux\u73af\u5883\u4e2d\uff0c\u662f\u901a\u8fc7 fork\u51fd\u6570 \u6765\u521b\u5efa\u5b50\u8fdb\u7a0b\u7684\u3002\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u7236\u5b50\u8fdb\u7a0b\u72ec\u7acb\u8fd0\u884c\uff0c\u7236\u8fdb\u7a0b\u65e0\u6cd5\u9884\u77e5\u5b50\u8fdb\u7a0b\u4ec0\u4e48\u65f6\u5019\u7ed3\u675f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> \u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5b50\u8fdb\u7a0b\u9000\u51fa\u540e\uff0c\u7236\u8fdb\u7a0b\u4f1a\u4f7f\u7528 wait \u6216 waitpid \u51fd\u6570\u8fdb\u884c\u56de\u6536\u5b50\u8fdb\u7a0b\u7684\u8d44\u6e90\uff0c\u5e76\u83b7\u5f97\u5b50\u8fdb\u7a0b\u7684\u7ec8\u6b62\u72b6\u6001\u3002\u4f46\u662f\uff0c\u5982\u679c\u7236\u8fdb\u7a0b\u5148\u4e8e\u5b50\u8fdb\u7a0b\u7ed3\u675f\uff0c\u5219\u5b50\u8fdb\u7a0b\u6210\u4e3a\u5b64\u513f\u8fdb\u7a0b\uff0c\u5b64\u513f\u8fdb\u7a0b\u5c06\u88ab init \u8fdb\u7a0b\uff08\u8fdb\u7a0b\u53f7\u4e3a1\uff09\u9886\u517b\uff0c\u5e76\u7531 init \u8fdb\u7a0b\u5bf9\u5b64\u513f\u8fdb\u7a0b\u5b8c\u6210\u72b6\u6001\u6536\u96c6\u5de5\u4f5c\u3002 <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uff081\uff09\u8fdb\u7a0b\u4e2d\u7684\u6307\u4ee4\u5df2\u7ecf\u6267\u884c\u5b8c\u6210\uff0c\u4f46\u662f\u8fdb\u7a0bPCB(process control block\uff0c\u8fdb\u7a0b\u63a7\u5236\u5757\uff0c\u672c\u8d28\u662f\u4e00\u4e2a\u7ed3\u6784\u4f53)\u7ed3\u6784\u8fd8\u6ca1\u6709\u56de\u6536\u3002\u5373\u5b50\u8fdb\u7a0b\u5148\u4e8e\u7236\u8fdb\u7a0b\u9000\u51fa\u540e\uff0c\u5b50\u8fdb\u7a0b\u7684PCB\u9700\u8981\u5176\u7236\u8fdb\u7a0b\u91ca\u653e\uff0c\u4f46\u662f\u7236\u8fdb\u7a0b\u5e76\u6ca1\u6709\u91ca\u653e\u5b50\u8fdb\u7a0b\u7684PCB\uff0c\u8fd9\u6837\u7684\u5b50\u8fdb\u7a0b\u5c31\u79f0\u4e3a\u50f5\u5c38\u8fdb\u7a0b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uff082\uff09\u7236\u8fdb\u7a0b\u672a\u7ed3\u675f\uff0c\u5b50\u8fdb\u7a0b\u7ed3\u675f\uff0c\u4f46\u7236\u8fdb\u7a0b\u6ca1\u6709\u5904\u7406\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u72b6\u6001\uff08\u5f53\u5b50\u8fdb\u7a0b\u5148\u4e8e\u7236\u8fdb\u7a0b\u7ed3\u675f\uff0c\u7236\u8fdb\u7a0b\u6ca1\u6709\u83b7\u53d6\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u7801\uff0c\u5b50\u8fdb\u7a0b\u7684PCB\u4f1a\u4fdd\u7559\u4e00\u6bb5\u65f6\u95f4\u7b49\u5f85\u7236\u8fdb\u7a0b\u5728PCB\u4e2d\u83b7\u53d6\u9000\u51fa\u7801\uff0c\u4e14\u8be5\u8fdb\u7a0b\u4e0d\u53ef\u6267\u884c\uff0c\u6b64\u65f6\u5b50\u8fdb\u7a0b\u53d8\u6210\u50f5\u5c38\u8fdb\u7a0b\uff09\u3002\u76f4\u5230\u7236\u8fdb\u7a0b\u83b7\u53d6\u5230\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u72b6\u6001\uff0c\u5b50\u8fdb\u7a0b\u7684PCB\u624d\u4f1a\u88ab\u79fb\u9664\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7a0b\u5e8f\u5728\u9000\u51fa\u7684\u65f6\u5019\uff1areturn 0\uff0cexit(0)\uff0c\u8fd9\u4e2a0\u5c31\u662f\u9000\u51fa\u7801\uff08\u72b6\u6001\u4fe1\u606f\uff09\uff0c\u5b83\u5b58\u50a8\u5728\u5f53\u524d\u8fdb\u7a0b\u7684PCB\u4e2d\uff0c\u4f1a\u6709\u4e00\u4e2a\u6574\u578b\u503c\u6765\u5b58\u50a8\u9000\u51fa\u7801\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b50\u8fdb\u7a0b\u7ed3\u675f\u540e\uff0c\u4f1a\u628a\u9000\u51fa\u7801\u5199\u5230PCB\u4e2d\uff0c\u7136\u540e\u5e0c\u671b\u7236\u8fdb\u7a0b\u53ef\u4ee5\u83b7\u5f97\u8fd9\u4e2a\u9000\u51fa\u7801\uff0c\u7236\u8fdb\u7a0b\u5c31\u53ef\u4ee5\u770b\u5230\u5b50\u8fdb\u7a0b\u662f\u6b63\u5e38\u8fd0\u884c\u7ed3\u675f\u8fd8\u662f\u51fa\u9519\u9000\u51fa\u3002\u6b63\u5e38\u7684\u8bdd return 0\uff1b\u5931\u8d25\u7684\u8bdd return -1\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8865\u5145\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7528ps\u548cgrep\u547d\u4ee4\u5bfb\u627e\u50f5\u5c38\u8fdb\u7a0b<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ps -A -o stat,ppid,pid,cmd |grep -e &#8216;^[Zz]&#8217;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u547d\u4ee4\u6ce8\u89e3\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>-A\uff1a\u53c2\u6570\u5217\u51fa\u6240\u6709\u8fdb\u7a0b<\/li>\n\n\n\n<li>-o\uff1a\u81ea\u5b9a\u4e49\u8f93\u51fa\u5b57\u6bb5\uff0c\u5728\u8fd9\u91cc\u8bbe\u5b9a\u7684\u663e\u793a\u5b57\u6bb5\u4e3a stat(\u72b6\u6001)\uff0cppid(\u8fdb\u7a0b\u7236id)\uff0cpid(\u8fdb\u7a0bid)\uff0ccmd(\u547d\u4ee4) \u8fd9\u56db\u4e2a\u53c2\u6570\uff0c\u7b5b\u9009\u72b6\u6001\u4e3az\u6216\u8005Z\u7684\u50f5\u5c38\u8fdb\u7a0b\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u7528kill -HUP xxx\u6740\u6b7b\u7236\u8fdb\u7a0b\u548c\u5b50\u8fdb\u7a0b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>kill\u547d\u4ee4\u7684\u6240\u6709\u4fe1\u53f7\u503c\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@k8s-master ~]# kill -l\n 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP\n 6) SIGABRT      7) SIGBUS       8) SIGFPE       9) SIGKILL     10) SIGUSR1\n11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM\n16) SIGSTKFLT   17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP\n21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU     25) SIGXFSZ\n26) SIGVTALRM   27) SIGPROF     28) SIGWINCH    29) SIGIO       30) SIGPWR\n31) SIGSYS      34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3\n38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8\n43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13\n48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12\n53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7\n58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2\n63) SIGRTMAX-1  64) SIGRTMAX<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53c2\u8003\u94fe\u63a5\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">https:\/\/www.linuxso.com\/command\/kill_2.html<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">https:\/\/blog.csdn.net\/qq_44824574\/article\/details\/122518296<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">https:\/\/baijiahao.baidu.com\/s?id=1716555315649688899&#038;wfr=spider&#038;for=pc<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u529f\u80fd\u8bf4\u660e\uff1a\u5220\u9664\u6267\u884c\u4e2d\u7684\u7a0b\u5e8f\u6216\u5de5\u4f5c\u3002 \u8bed\u6cd5\uff1akill&#038;nbsp &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_zb_attr":"","zolo_post_video_link":"","footnotes":""},"categories":[11],"tags":[],"series":[],"class_list":["post-157","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.dataz8.com\/index.php?rest_route=\/wp\/v2\/posts\/157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dataz8.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dataz8.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dataz8.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dataz8.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=157"}],"version-history":[{"count":41,"href":"https:\/\/www.dataz8.com\/index.php?rest_route=\/wp\/v2\/posts\/157\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/www.dataz8.com\/index.php?rest_route=\/wp\/v2\/posts\/157\/revisions\/287"}],"wp:attachment":[{"href":"https:\/\/www.dataz8.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataz8.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataz8.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=157"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.dataz8.com\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}