{"id":139495,"date":"2019-03-30T10:00:03","date_gmt":"2019-03-30T02:00:03","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=139495"},"modified":"2019-03-25T13:44:05","modified_gmt":"2019-03-25T05:44:05","slug":"linux-stopped-process","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-stopped-process.html","title":{"rendered":"\u5982\u4f55\u67e5\u6740stopped\u8fdb\u7a0b"},"content":{"rendered":"
\u5728Linux\u7cfb\u7edf\u4e0b\u9762\uff0ctop\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u67e5\u770bstopped\u8fdb\u7a0b\u3002\u4f46\u662f\u4e0d\u80fd\u67e5\u770bstopped\u8fdb\u7a0b\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u90a3\u4e48\u5982\u4f55\u67e5\u770bstopped \u8fdb\u7a0b\uff0c\u5e76\u4e14\u6740\u6389\u8fd9\u4e9bstopped\u8fdb\u7a0b\u5462\uff1f<\/p>\n
ps<\/span>\u00a0-e\u00a0j\u00a0|\u00a0grep\u00a0T\u00a0\r\n<\/pre>\n<\/p>\n
stopped\u8fdb\u7a0b\u7684STAT\u72b6\u6001\u4e3aT\uff0c\u4e00\u822c\u800c\u8a00,\u8fdb\u7a0b\u6709\u4e0b\u9762\u8fd9\u4e9b\u72b6\u6001\u7801\uff1a<\/p>\n
D\u00a0\u00a0\u00a0\u00a0uninterruptible\u00a0sleep\u00a0(usually\u00a0IO)\r\nI\u00a0\u00a0\u00a0\u00a0Idle\u00a0kernel\u00a0thread\r\nR\u00a0\u00a0\u00a0\u00a0running\u00a0or<\/span>\u00a0runnable\u00a0(on<\/span>\u00a0run\u00a0queue)\r\nS\u00a0\u00a0\u00a0\u00a0interruptible\u00a0sleep\u00a0(waiting\u00a0for<\/span>\u00a0an\u00a0event<\/span>\u00a0to<\/span>\u00a0complete)\r\nT\u00a0\u00a0\u00a0\u00a0stopped\u00a0by<\/span>\u00a0job\u00a0control\u00a0signal\r\nt\u00a0\u00a0\u00a0\u00a0stopped\u00a0by<\/span>\u00a0debugger\u00a0during\u00a0the\u00a0tracing\r\nW\u00a0\u00a0\u00a0\u00a0paging\u00a0(not<\/span>\u00a0valid\u00a0since\u00a0the\u00a02.6<\/span>.xx\u00a0kernel)\r\nX\u00a0\u00a0\u00a0\u00a0dead\u00a0(should\u00a0never\u00a0be\u00a0seen)\r\nZ\u00a0\u00a0\u00a0\u00a0defunct\u00a0(\"zombie\"<\/span>)\u00a0process,\u00a0terminated\u00a0but\u00a0not<\/span>\u00a0reaped\u00a0by<\/span>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0its\u00a0parent\r\n\r\nfor<\/span>\u00a0BSD\u00a0formats\u00a0and<\/span>\u00a0when<\/span>\u00a0the\u00a0stat\u00a0keyword\u00a0is<\/span>\u00a0used,\u00a0additional\r\nrs\u00a0may\u00a0be\u00a0displayed:\r\n\r\n<\u00a0\u00a0\u00a0\u00a0high-priority\u00a0(not<\/span>\u00a0nice\u00a0to<\/span>\u00a0other\u00a0users)\r\nN\u00a0\u00a0\u00a0\u00a0low-priority\u00a0(nice\u00a0to<\/span>\u00a0other\u00a0users)\r\nL\u00a0\u00a0\u00a0\u00a0has\u00a0pages\u00a0locked\u00a0into<\/span>\u00a0memory\u00a0(for<\/span>\u00a0real-time\u00a0and<\/span>\u00a0custom<\/span>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0IO)\r\ns\u00a0\u00a0\u00a0\u00a0is<\/span>\u00a0a\u00a0session\u00a0leader\r\nl\u00a0\u00a0\u00a0\u00a0is<\/span>\u00a0multi-threaded\u00a0(using<\/span>\u00a0CLONE_THREAD,\u00a0like<\/span>\u00a0NPTL\r\n\u00a0\u00a0\u00a0\u00a0\u00a0pthreads\u00a0do<\/span>)\r\n+\u00a0\u00a0\u00a0\u00a0is<\/span>\u00a0in<\/span>\u00a0the\u00a0foreground\u00a0process\u00a0group<\/span><\/pre>\n\u4e00\u822c\u8f83\u5e38\u89c1\u7684\u662f5\u79cd\u72b6\u6001\u7801\uff1a<\/p>\n
\r\n \tD \u4e0d\u53ef\u4e2d\u65ad uninterruptible sleep (usually IO)\r\n R \u8fd0\u884c runnable (on run queue)\r\n \tS \u4e2d\u65ad sleeping\r\n \tT \u505c\u6b62 traced or stopped\r\n \tZ \u50f5\u6b7b a defunct (\u201dzombie\u201d) process\r\n<\/pre>\n\u6240\u4ee5\uff0c\u53ef\u4ee5\u7528\u4e0b\u9762\u547d\u4ee4ps -A -ostat,ppid,pid,cmd | grep -e \u2018^[T]\u2018 \u67e5\u770bstopped\u7684\u8fdb\u7a0b\u4fe1\u606f\uff0c\u8fdb\u800c\u4f7f\u7528kill\u547d\u4ee4\u5c06\u8fdb\u7a0b\u5b8c\u5168\u6740\u6b7b\u3002\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n
#\u00a0\u00a0ps\u00a0-A\u00a0-ostat,ppid,pid,cmd\u00a0|\u00a0grep\u00a0-e\u00a0'^[T]'<\/span>\r\n\r\nT<\/span>\u00a0\u00a0\u00a0\u00a0\u00a06777<\/span>\u00a0\u00a08635<\/span>\u00a0more\u00a0alert_pps.log\r\nT<\/span>\u00a0\u00a0\u00a0\u00a0\u00a06777<\/span>\u00a0\u00a09654<\/span>\u00a0tail\u00a0-60f\u00a0alert_pps.log\r\nT<\/span>\u00a0\u00a0\u00a0\u00a0\u00a06777<\/span>\u00a010724<\/span>\u00a0top\r\n#\u00a0kill\u00a0-9\u00a08635<\/span>\r\n#\u00a0\u00a0ps\u00a0-A\u00a0-ostat,ppid,pid,cmd\u00a0|\u00a0grep\u00a0-e\u00a0'^[T]'<\/span>\r\nT<\/span>\u00a0\u00a0\u00a0\u00a0\u00a06777<\/span>\u00a0\u00a09654<\/span>\u00a0tail\u00a0-60f\u00a0alert_pps.log\r\nT<\/span>\u00a0\u00a0\u00a0\u00a0\u00a06777<\/span>\u00a010724<\/span>\u00a0top\r\n#\u00a0kill\u00a0-9\u00a09654<\/span>\r\n#\u00a0kill\u00a0-9\u00a010724<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"\u5728Linux\u7cfb\u7edf\u4e0b\u9762\uff0ctop\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u67e5\u770bstopped\u8fdb\u7a0b\u3002\u4f46\u662f\u4e0d\u80fd\u67e5\u770bstopped\u8fdb\u7a0b\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u90a3\u4e48 […]<\/p>\n","protected":false},"author":63,"featured_media":139502,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-139495","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/139495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=139495"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/139495\/revisions"}],"predecessor-version":[{"id":140745,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/139495\/revisions\/140745"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/139502"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=139495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=139495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=139495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}