{"id":52132,"date":"2024-12-03T08:18:21","date_gmt":"2024-12-03T00:18:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52132\/"},"modified":"2024-12-03T08:18:21","modified_gmt":"2024-12-03T00:18:21","slug":"linux%e7%9a%84%e4%bf%a1%e5%8f%b7%e6%9c%89%e5%93%aa%e4%ba%9b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52132\/","title":{"rendered":"linux\u7684\u4fe1\u53f7\u6709\u54ea\u4e9b"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>linux\u7684\u4fe1\u53f7\u6709\u54ea\u4e9b<\/h1>\n<p>\u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6587\u7ae0\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300alinux\u7684\u4fe1\u53f7\u6709\u54ea\u4e9b\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01<\/p>\n<\/p>\n<blockquote>\n<p>linux\u4fe1\u53f7\u6709\uff1a1\u3001SIGHUP\uff0c\u7528\u4e8e\u8ba9\u8fdb\u7a0b\u7acb\u5373\u5173\u95ed\uff0c\u7136\u540e\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u4e4b\u540e\u91cd\u542f\uff1b2\u3001SIGINT\uff0c\u7a0b\u5e8f\u4e2d\u6b62\u4fe1\u53f7\uff0c\u7528\u4e8e\u4e2d\u6b62\u524d\u53f0\u8fdb\u7a0b\uff1b3\u3001SIGQUIT\uff0c\u7a0b\u5e8f\u9000\u51fa\u4fe1\u53f7\uff1b4\u3001SIGFPE\uff0c\u5728\u53d1\u751f\u81f4\u547d\u7684\u7b97\u672f\u8fd0\u7b97\u9519\u8bef\u65f6\u53d1\u51fa\uff1b5\u3001SIGKILL\uff0c\u7528\u6765\u7acb\u5373\u7ed3\u675f\u7a0b\u5e8f\u7684\u8fd0\u884c\uff1b6\u3001SIGALRM\uff0c\u65f6\u949f\u5b9a\u65f6\u4fe1\u53f7\uff1b7\u3001SIGTERM\uff0c\u6b63\u5e38\u7ed3\u675f\u8fdb\u7a0b\u7684\u4fe1\u53f7\uff1b8\u3001SIGCONT\uff1b9\u3001SIGSTOP\u7b49\u3002<\/p>\n<\/blockquote>\n<p><strong>linux\u4e2d\u4fe1\u53f7\u662f\u4ec0\u4e48<\/strong><\/p>\n<p>\u8fdb\u7a0b\u7684\u7ba1\u7406\u4e3b\u8981\u662f\u6307\u8fdb\u7a0b\u7684\u5173\u95ed\u4e0e\u91cd\u542f\u3002\u6211\u4eec\u4e00\u822c\u5173\u95ed\u6216\u91cd\u542f\u8f6f\u4ef6\uff0c\u90fd\u662f\u5173\u95ed\u6216\u91cd\u542f\u5b83\u7684\u7a0b\u5e8f\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u64cd\u4f5c\u8fdb\u7a0b\u7684\u3002\u6bd4\u5982\uff0c\u8981\u91cd\u542f apache \u670d\u52a1\uff0c\u4e00\u822c\u4f7f\u7528\u547d\u4ee4&#8221;service httpd restart&#8221;\u91cd\u542f apache\u7684\u7a0b\u5e8f\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u53ef\u4ee5\u901a\u8fc7\u76f4\u63a5\u7ba1\u7406\u8fdb\u7a0b\u6765\u5173\u95ed\u6216\u91cd\u542f apache \u5417\uff1f\u7b54\u6848\u662f\u80af\u5b9a\u7684\uff0c\u8fd9\u65f6\u5c31\u8981\u4f9d\u8d56\u8fdb\u7a0b\u7684\u4fe1\u53f7\uff08Signal\uff09\u4e86\u3002\u6211\u4eec\u9700\u8981\u7ed9\u4e88\u8be5\u8fdb\u7a0b\u53f7\uff0c\u544a\u8bc9\u8fdb\u7a0b\u6211\u4eec\u60f3\u8981\u8ba9\u5b83\u505a\u4ec0\u4e48\u3002<\/p>\n<p>\u7cfb\u7edf\u4e2d\u53ef\u4ee5\u8bc6\u522b\u7684\u4fe1\u53f7\u8f83\u591a\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4&#8221;kill -l&#8221;\u6216&#8221;man 7 signal&#8221;\u6765\u67e5\u8be2\u3002\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<pre>[root@localhost&nbsp;~]#kill&nbsp;-l\n1)&nbsp;SIGHUP&nbsp;2)&nbsp;SIGINT&nbsp;3)&nbsp;SIGQUIT&nbsp;4)&nbsp;SIGILL&nbsp;5)&nbsp;SIGTRAP\n6)&nbsp;SIGABRT&nbsp;7)&nbsp;SIGBUS&nbsp;8)&nbsp;SIGFPE&nbsp;9)&nbsp;SIGKILL&nbsp;10)&nbsp;SIGUSR1\n11)SIGSEGV&nbsp;12)&nbsp;SIGUSR2&nbsp;13)&nbsp;SIGPIPE&nbsp;14)&nbsp;SIGALRM&nbsp;15)SIGTERM&nbsp;16)&nbsp;SIGSTKFLT&nbsp;17)&nbsp;SIGCHLD&nbsp;18)&nbsp;SIGCONT&nbsp;19)&nbsp;SIGSTOP&nbsp;20)&nbsp;SIGTSTP&nbsp;21)&nbsp;SIGTTIN&nbsp;22)&nbsp;SIGTTOU&nbsp;23)&nbsp;SIGURG\n24)&nbsp;SIGXCPU&nbsp;25)&nbsp;SIGXFSZ&nbsp;26)&nbsp;SIGVTALRM&nbsp;27)&nbsp;SIGPROF&nbsp;28)&nbsp;SIGWINCH&nbsp;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be5\u4fe1\u53f7\u8ba9\u8fdb\u7a0b\u7acb\u5373\u5173\u95ed.\u7136\u540e\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u4e4b\u540e\u91cd\u542f<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>SIGINT<\/td>\n<td>\u7a0b\u5e8f\u4e2d\u6b62\u4fe1\u53f7\uff0c\u7528\u4e8e\u4e2d\u6b62\u524d\u53f0\u8fdb\u7a0b\u3002\u76f8\u5f53\u4e8e\u8f93\u51fa Ctrl+C \u5feb\u6377\u952e<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">3<\/td>\n<td colspan=\"1\" rowspan=\"1\">SIGQUIT<\/td>\n<td colspan=\"1\" rowspan=\"1\">\u7a0b\u5e8f\u9000\u51fa\u4fe1\u53f7\uff08\u540c Ctrl + \\\uff09<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>SIGFPE<\/td>\n<td>\u5728\u53d1\u751f\u81f4\u547d\u7684\u7b97\u672f\u8fd0\u7b97\u9519\u8bef\u65f6\u53d1\u51fa\u3002\u4e0d\u4ec5\u5305\u62ec\u6d6e\u70b9\u8fd0\u7b97\u9519\u8bef\uff0c\u8fd8\u5305\u62ec\u6ea2\u51fa\u53ca\u9664\u6570\u4e3a 0 \u7b49\u5176\u4ed6\u6240\u6709\u7684\u7b97\u672f\u8fd0\u7b97\u9519\u8bef<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>SIGKILL<\/td>\n<td>\u7528\u6765\u7acb\u5373\u7ed3\u675f\u7a0b\u5e8f\u7684\u8fd0\u884c\u3002\u672c\u4fe1\u53f7\u4e0d\u80fd\u88ab\u963b\u585e\u3001\u5904\u7406\u548c\u5ffd\u7565\u3002\u822c\u7528\u4e8e\u5f3a\u5236\u4e2d\u6b62\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>SIGALRM<\/td>\n<td>\u65f6\u949f\u5b9a\u65f6\u4fe1\u53f7\uff0c\u8ba1\u7b97\u7684\u662f\u5b9e\u9645\u7684\u65f6\u95f4\u6216\u65f6\u949f\u65f6\u95f4\u3002alarm \u51fd\u6570\u4f7f\u7528\u8be5\u4fe1\u53f7<\/td>\n<\/tr>\n<tr>\n<td>15<\/td>\n<td>SIGTERM<\/td>\n<td>\u6b63\u5e38\u7ed3\u675f\u8fdb\u7a0b\u7684\u4fe1\u53f7\uff0ckill \u547d\u4ee4\u7684\u9ed8\u8ba4\u4fe1\u53f7\u3002\u5982\u679c\u8fdb\u7a0b\u5df2\u7ecf\u53d1\u751f\u4e86\u95ee\u9898\uff0c\u90a3\u4e48\u8fd9 \u4e2a\u4fe1\u53f7\u662f\u65e0\u6cd5\u6b63\u5e38\u4e2d\u6b62\u8fdb\u7a0b\u7684\uff0c\u8fd9\u65f6\u6211\u4eec\u624d\u4f1a\u5c1d\u8bd5 SIGKILL \u4fe1\u53f7\uff0c\u4e5f\u5c31\u662f\u4fe1\u53f7 9<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>SIGCONT<\/td>\n<td>\u8be5\u4fe1\u53f7\u53ef\u4ee5\u8ba9\u6682\u505c\u7684\u8fdb\u7a0b\u6062\u590d\u6267\u884c\u3002\u672c\u4fe1\u53f7\u4e0d\u80fd\u88ab\u963b\u65ad<\/td>\n<\/tr>\n<tr>\n<td>19<\/td>\n<td>SIGSTOP<\/td>\n<td>\u8be5\u4fe1\u53f7\u53ef\u4ee5\u6682\u505c\u524d\u53f0\u8fdb\u7a0b\uff0c\u76f8\u5f53\u4e8e\u8f93\u5165 Ctrl+Z \u5feb\u6377\u952e\u3002\u672c\u4fe1\u53f7\u4e0d\u80fd\u88ab\u963b\u65ad<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>KILL, STOP \u4fe1\u53f7\u4e0d\u53ef\u88ab\u963b\u585e\u3001\u5ffd\u7565\u3001\u6355\u83b7\u3002<\/p>\n<p>Term \u8868\u793a\u7ec8\u6b62\u8fdb\u7a0b\u3002Core \u8868\u793a\u7ec8\u6b62\u8fdb\u7a0b\u5e76 dump core\u3002Stop \u6302\u8d77\u7ebf\u7a0b\uff0cCont \u6062\u590d\u6302\u8d77\u7684\u7ebf\u7a0b\u3002<\/p>\n<p><strong>\u5e38\u89c1\u4fe1\u53f7\u7684\u5e38\u89c1\u7528\u9014<\/strong><\/p>\n<ul>\n<li>\n<p>SIGHUP<\/p>\n<p>\u672c\u4fe1\u53f7\u5728\u7528\u6237\u7ec8\u7aef\u8fde\u63a5(\u6b63\u5e38\u6216\u975e\u6b63\u5e38)\u7ed3\u675f\u65f6\u53d1\u51fa, \u901a\u5e38\u662f\u5728\u7ec8\u7aef\u7684\u63a7\u5236\u8fdb\u7a0b\u7ed3\u675f\u65f6, \u901a\u77e5\u540c\u4e00\u4f1a\u8bdd\u5185\u7684\u5404\u4e2a\u4f5c\u4e1a, \u8fd9\u65f6\u5b83\u4eec\u4e0e\u63a7\u5236\u7ec8\u7aef\u4e0d\u518d\u5173\u8054\u3002<\/p>\n<p>\u767b\u5f55Linux\u65f6\uff0c\u7cfb\u7edf\u4f1a\u5206\u914d\u7ed9\u767b\u5f55\u7528\u6237\u4e00\u4e2a\u7ec8\u7aef\u4f1a\u8bdd(Session)\u3002\u5728\u8fd9\u4e2a\u7ec8\u7aef\u8fd0\u884c\u7684\u6240\u6709\u7a0b\u5e8f\uff0c\u5305\u62ec\u524d\u53f0\u8fdb\u7a0b\u7ec4\u548c\u540e\u53f0\u8fdb\u7a0b\u7ec4\uff0c\u4e00\u822c\u90fd\u5c5e\u4e8e\u8fd9\u4e2a\u4f1a\u8bdd\u3002\u5f53\u7528\u6237\u9000\u51faLinux\u767b\u5f55\u65f6\uff0c\u524d\u53f0\u8fdb\u7a0b\u7ec4\u548c\u540e\u53f0\u6709\u5bf9\u7ec8\u7aef\u8f93\u51fa\u7684\u8fdb\u7a0b\u5c06\u4f1a\u6536\u5230SIGHUP\u4fe1\u53f7\u3002<\/p>\n<p>\u8fd9\u4e2a\u4fe1\u53f7\u7684\u9ed8\u8ba4\u64cd\u4f5c\u4e3a\u7ec8\u6b62\u8fdb\u7a0b\uff0c\u56e0\u6b64\u9000\u51fa\u767b\u5f55\u4e4b\u540e\uff0c\u524d\u540e\u53f0\u8fdb\u7a0b\u548c\u540e\u53f0\u6709\u7ec8\u7aef\u8f93\u51fa\u7684\u8fdb\u7a0b\u5c31\u4f1a\u4e2d\u6b62\u3002<\/p>\n<p>\u4e0d\u8fc7\u53ef\u4ee5\u6355\u83b7\u8fd9\u4e2a\u4fe1\u53f7\uff0c\u6bd4\u5982wget\u80fd\u6355\u83b7SIGHUP\u4fe1\u53f7\uff0c\u5e76\u5ffd\u7565\u5b83\uff0c\u8fd9\u6837\u5c31\u7b97\u9000\u51fa\u4e86Linux\u767b\u5f55\uff0cwget\u4e5f\u80fd\u7ee7\u7eed\u4e0b\u8f7d\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u5bf9\u4e8e\u4e0e\u7ec8\u7aef\u8131\u79bb\u5173\u7cfb\u7684\u5b88\u62a4\u8fdb\u7a0b\uff0c\u8fd9\u4e2a\u4fe1\u53f7\u7528\u4e8e\u901a\u77e5\u5b83\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<p>\u6bd4\u5982\uff0c\u5411 nginx \u8fdb\u7a0b\u53d1\u9001 HUP \u4fe1\u53f7\u5c31\u53ef\u4ee5\u5237\u65b0\u914d\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>SIGINT\uff1a\u7a0b\u5e8f\u7ec8\u6b62(interrupt)\u4fe1\u53f7, \u5728\u7528\u6237\u952e\u5165INTR\u5b57\u7b26(\u901a\u5e38\u662fCtrl-C)\u65f6\u53d1\u51fa\uff0c\u7528\u4e8e\u901a\u77e5\u524d\u53f0\u8fdb\u7a0b\u7ec4\u7ec8\u6b62\u8fdb\u7a0b\u3002<\/p>\n<\/li>\n<li>\n<p>SIGQUIT\uff1a\u548cSIGINT\u7c7b\u4f3c, \u4f46\u7531QUIT\u5b57\u7b26(\u901a\u5e38\u662fCtrl-\\)\u6765\u63a7\u5236. \u8fdb\u7a0b\u5728\u56e0\u6536\u5230SIGQUIT\u9000\u51fa\u65f6\u4f1a\u4ea7\u751fcore\u6587\u4ef6, \u5728\u8fd9\u4e2a\u610f\u4e49\u4e0a\u7c7b\u4f3c\u4e8e\u4e00\u4e2a\u7a0b\u5e8f\u9519\u8bef\u4fe1\u53f7\u3002<\/p>\n<\/li>\n<li>\n<p>SIGTERM\uff1a<\/p>\n<p>\u7a0b\u5e8f\u7ed3\u675f(terminate)\u4fe1\u53f7, \u4e0eSIGKILL\u4e0d\u540c\u7684\u662f\u8be5\u4fe1\u53f7\u53ef\u4ee5\u88ab\u963b\u585e\u548c\u5904\u7406\u3002\u901a\u5e38\u7528\u6765\u8981\u6c42\u7a0b\u5e8f\u81ea\u5df1\u6b63\u5e38\u9000\u51fa\uff0c\u5141\u8bb8\u8fdb\u7a0b\u505a\u4e00\u4e9b\u5fc5\u8981\u7684\u6e05\u7406\u5de5\u4f5c\u540e\u9000\u51fa\u3002<\/p>\n<p>shell\u547d\u4ee4kill\u7f3a\u7701\u4ea7\u751f\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5982\u679c\u8fdb\u7a0b\u7ec8\u6b62\u4e0d\u4e86\uff0c\u6211\u4eec\u624d\u4f1a\u5c1d\u8bd5SIGKILL\u3002<\/p>\n<\/li>\n<li>\n<p>SIGTERM \u8ba9\u8fdb\u7a0b\u4f53\u9762\u7684\u7ed3\u675f\uff0c\u5982\u679c\u8fdb\u7a0b\u81ea\u5df1\u4e0d\u4f53\u9762\uff0c\u5c31\u7528 SIGKILL \u5e2e\u5b83\u4f53\u9762\u3002<\/p>\n<\/li>\n<li>\n<p>SIGCONT\uff1a\u8ba9\u4e00\u4e2a\u505c\u6b62(stopped)\u7684\u8fdb\u7a0b\u7ee7\u7eed\u6267\u884c. \u672c\u4fe1\u53f7\u4e0d\u80fd\u88ab\u963b\u585e. \u53ef\u4ee5\u7528\u4e00\u4e2ahandler\u6765\u8ba9\u7a0b\u5e8f\u5728\u7531stopped\u72b6\u6001\u53d8\u4e3a\u7ee7\u7eed\u6267\u884c\u65f6\u5b8c\u6210\u7279\u5b9a\u7684\u5de5\u4f5c. \u4f8b\u5982, \u91cd\u65b0\u663e\u793a\u63d0\u793a\u7b26\u2026<\/p>\n<\/li>\n<li>\n<p>SIGSTOP\uff1a\u505c\u6b62(stopped)\u8fdb\u7a0b\u7684\u6267\u884c. \u6ce8\u610f\u5b83\u548cterminate\u4ee5\u53cainterrupt\u7684\u533a\u522b:\u8be5\u8fdb\u7a0b\u8fd8\u672a\u7ed3\u675f, \u53ea\u662f\u6682\u505c\u6267\u884c. \u672c\u4fe1\u53f7\u4e0d\u80fd\u88ab\u963b\u585e, \u5904\u7406\u6216\u5ffd\u7565.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u5e38\u7528\u4fe1\u53f7\u5feb\u6377\u952e<\/strong><\/p>\n<ul>\n<li>\n<p>ctrl-c \u53d1\u9001 SIGINT \u4fe1\u53f7\u7ed9\u524d\u53f0\u8fdb\u7a0b\u7ec4\u4e2d\u7684\u6240\u6709\u8fdb\u7a0b\u3002\u5e38\u7528\u4e8e\u7ec8\u6b62\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\u3002<\/p>\n<\/li>\n<li>\n<p>ctrl-z \u53d1\u9001 SIGTSTP \u4fe1\u53f7\u7ed9\u524d\u53f0\u8fdb\u7a0b\u7ec4\u4e2d\u7684\u6240\u6709\u8fdb\u7a0b\uff0c\u5e38\u7528\u4e8e\u6302\u8d77\u4e00\u4e2a\u8fdb\u7a0b\u3002<\/p>\n<\/li>\n<li>\n<p>ctrl-d \u4e0d\u662f\u53d1\u9001\u4fe1\u53f7\uff0c\u800c\u662f\u8868\u793a\u4e00\u4e2a\u7279\u6b8a\u7684\u4e8c\u8fdb\u5236\u503c\uff0c\u8868\u793a EOF\u3002<\/p>\n<\/li>\n<li>\n<p>ctrl-\\ \u53d1\u9001 SIGQUIT \u4fe1\u53f7\u7ed9\u524d\u53f0\u8fdb\u7a0b\u7ec4\u4e2d\u7684\u6240\u6709\u8fdb\u7a0b\uff0c\u7ec8\u6b62\u524d\u53f0\u8fdb\u7a0b\u5e76\u751f\u6210 core \u6587\u4ef6\u3002<\/p>\n<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Function<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>Ctrl-c<\/code><\/td>\n<td>Kill foreground process<\/td>\n<\/tr>\n<tr>\n<td><code>Ctrl-z<\/code><\/td>\n<td>Suspend foreground process<\/td>\n<\/tr>\n<tr>\n<td><code>Ctrl-d<\/code><\/td>\n<td>Terminate input, or exit shell<\/td>\n<\/tr>\n<tr>\n<td><code>Ctrl-s<\/code><\/td>\n<td>Suspend output<\/td>\n<\/tr>\n<tr>\n<td><code>Ctrl-q<\/code><\/td>\n<td>Resume output<\/td>\n<\/tr>\n<tr>\n<td><code>Ctrl-o<\/code><\/td>\n<td>Discard output<\/td>\n<\/tr>\n<tr>\n<td><code>Ctrl-l<\/code><\/td>\n<td>Clear screen<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4eca\u5929\u5173\u4e8e\u300alinux\u7684\u4fe1\u53f7\u6709\u54ea\u4e9b\u300b\u7684\u5185\u5bb9\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u662f\u4e0d\u662f\u5b66\u8d77\u6765\u4e00\u76ee\u4e86\u7136\uff01\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8eLinux\u7684\u5185\u5bb9\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u7684\u4fe1\u53f7\u6709\u54ea\u4e9b \u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6587\u7ae0\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300alinux\u7684\u4fe1\u53f7\u6709\u54ea\u4e9b\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01 linux\u4fe1\u53f7\u6709\uff1a1\u3001SIGHUP\uff0c\u7528\u4e8e\u8ba9\u8fdb\u7a0b\u7acb\u5373\u5173\u95ed\uff0c\u7136\u540e\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u4e4b\u540e\u91cd\u542f\uff1b2\u3001SIGINT\uff0c\u7a0b\u5e8f\u4e2d\u6b62\u4fe1\u53f7\uff0c\u7528\u4e8e\u4e2d\u6b62\u524d\u53f0\u8fdb\u7a0b\uff1b3\u3001SIGQUIT\uff0c\u7a0b\u5e8f\u9000\u51fa\u4fe1\u53f7\uff1b4\u3001SIGFPE\uff0c\u5728\u53d1\u751f\u81f4\u547d\u7684\u7b97\u672f\u8fd0\u7b97\u9519\u8bef\u65f6\u53d1\u51fa\uff1b5\u3001SIGKILL\uff0c\u7528\u6765\u7acb\u5373\u7ed3\u675f\u7a0b\u5e8f\u7684\u8fd0\u884c\uff1b6\u3001SIGALRM\uff0c\u65f6\u949f\u5b9a\u65f6\u4fe1\u53f7\uff1b7\u3001SIGTERM\uff0c\u6b63\u5e38\u7ed3\u675f\u8fdb\u7a0b\u7684\u4fe1\u53f7\uff1b8\u3001SIGCONT\uff1b9\u3001SIGSTOP\u7b49\u3002 linux\u4e2d\u4fe1\u53f7\u662f\u4ec0\u4e48 \u8fdb\u7a0b\u7684\u7ba1\u7406\u4e3b\u8981\u662f\u6307\u8fdb\u7a0b\u7684\u5173\u95ed\u4e0e\u91cd\u542f\u3002\u6211\u4eec\u4e00\u822c\u5173\u95ed\u6216\u91cd\u542f\u8f6f\u4ef6\uff0c\u90fd\u662f\u5173\u95ed\u6216\u91cd\u542f\u5b83\u7684\u7a0b\u5e8f\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u64cd\u4f5c\u8fdb\u7a0b\u7684\u3002\u6bd4\u5982\uff0c\u8981\u91cd\u542f apache \u670d\u52a1\uff0c\u4e00\u822c\u4f7f\u7528\u547d\u4ee4&#8221;service httpd restart&#8221;\u91cd\u542f apache\u7684\u7a0b\u5e8f\u3002 \u90a3\u4e48\uff0c\u53ef\u4ee5\u901a\u8fc7\u76f4\u63a5\u7ba1\u7406\u8fdb\u7a0b\u6765\u5173\u95ed\u6216\u91cd\u542f apache \u5417\uff1f\u7b54\u6848\u662f\u80af\u5b9a\u7684\uff0c\u8fd9\u65f6\u5c31\u8981\u4f9d\u8d56\u8fdb\u7a0b\u7684\u4fe1\u53f7\uff08Signal\uff09\u4e86\u3002\u6211\u4eec\u9700\u8981\u7ed9\u4e88\u8be5\u8fdb\u7a0b\u53f7\uff0c\u544a\u8bc9\u8fdb\u7a0b\u6211\u4eec\u60f3\u8981\u8ba9\u5b83\u505a\u4ec0\u4e48\u3002 \u7cfb\u7edf\u4e2d\u53ef\u4ee5\u8bc6\u522b\u7684\u4fe1\u53f7\u8f83\u591a\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4&#8221;kill -l&#8221;\u6216&#8221;man 7 signal&#8221;\u6765\u67e5\u8be2\u3002\u547d\u4ee4\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;49)&nbsp;SIGRTMIN&nbsp;+15&nbsp;50)&nbsp;SIGRTMAX-14&nbsp;51)&nbsp;SIGRTMAX-13&nbsp;52)&nbsp;SIGRTMAX-12&nbsp;53)&nbsp;SIGRTMAX-11&nbsp;54)&nbsp;SIGRTMAX-10&nbsp;55)&nbsp;SIGRTMAX-9&nbsp;56)&nbsp;SIGRTMAX-8&nbsp;57)&nbsp;SIGRTMAX-7&nbsp;58)&nbsp;SIGRTMAX-6&nbsp;59)&nbsp;SIGRTMAX-5&nbsp;60)&nbsp;SIGRTMAX-4&nbsp;61)&nbsp;SIGRTMAX-3&nbsp;62)&nbsp;SIGRTMAX-2&nbsp;63)&nbsp;SIGRTMAX-1&nbsp;64)&nbsp;SIGRTMAX linux\u4e2d\u5e38\u89c1\u7684\u4fe1\u53f7 \u4fe1\u53f7\u4ee3\u53f7 \u4fe1\u53f7\u540d\u79f0 \u8bf4 \u660e 1 SIGHUP \u8be5\u4fe1\u53f7\u8ba9\u8fdb\u7a0b\u7acb\u5373\u5173\u95ed.\u7136\u540e\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u4e4b\u540e\u91cd\u542f 2 SIGINT \u7a0b\u5e8f\u4e2d\u6b62\u4fe1\u53f7\uff0c\u7528\u4e8e\u4e2d\u6b62\u524d\u53f0\u8fdb\u7a0b\u3002\u76f8\u5f53\u4e8e\u8f93\u51fa Ctrl+C \u5feb\u6377\u952e 3 SIGQUIT \u7a0b\u5e8f\u9000\u51fa\u4fe1\u53f7\uff08\u540c Ctrl + \\\uff09 8 SIGFPE \u5728\u53d1\u751f\u81f4\u547d\u7684\u7b97\u672f\u8fd0\u7b97\u9519\u8bef\u65f6\u53d1\u51fa\u3002\u4e0d\u4ec5\u5305\u62ec\u6d6e\u70b9\u8fd0\u7b97\u9519\u8bef\uff0c\u8fd8\u5305\u62ec\u6ea2\u51fa\u53ca\u9664\u6570\u4e3a 0 \u7b49\u5176\u4ed6\u6240\u6709\u7684\u7b97\u672f\u8fd0\u7b97\u9519\u8bef 9 SIGKILL \u7528\u6765\u7acb\u5373\u7ed3\u675f\u7a0b\u5e8f\u7684\u8fd0\u884c\u3002\u672c\u4fe1\u53f7\u4e0d\u80fd\u88ab\u963b\u585e\u3001\u5904\u7406\u548c\u5ffd\u7565\u3002\u822c\u7528\u4e8e\u5f3a\u5236\u4e2d\u6b62\u8fdb\u7a0b 14 SIGALRM \u65f6\u949f\u5b9a\u65f6\u4fe1\u53f7\uff0c\u8ba1\u7b97\u7684\u662f\u5b9e\u9645\u7684\u65f6\u95f4\u6216\u65f6\u949f\u65f6\u95f4\u3002alarm \u51fd\u6570\u4f7f\u7528\u8be5\u4fe1\u53f7 15 SIGTERM [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-52132","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52132"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52132\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}