{"id":36932,"date":"2022-09-05T15:04:21","date_gmt":"2022-09-05T19:04:21","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=36932"},"modified":"2022-09-05T15:04:57","modified_gmt":"2022-09-05T19:04:57","slug":"using-environment-variables-to-find-escaped-processes","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/09\/05\/using-environment-variables-to-find-escaped-processes\/","title":{"rendered":"Using Environment Variables to Find Escaped Processes"},"content":{"rendered":"<p><a href=\"https:\/\/medium.com\/@captaindomestic\/endangered-technique-using-environment-variables-to-find-escaped-processes-64eb7ff70602\">Ben Martin<\/a>:<\/p>\n<blockquote cite=\"https:\/\/medium.com\/@captaindomestic\/endangered-technique-using-environment-variables-to-find-escaped-processes-64eb7ff70602\">\n<p>Now what happens when the program crashes during a test? The developer is happy because they found a bug before submitting it. But the machine may not be. This type of crash will often leave behind child processes which will quickly gunk up the server, causing other tests to fail in unexpected ways. We need to find and terminate these stray processes or work will quickly grind to a halt.<\/p>\n<p>[&#8230;]<\/p>\n<p>Environment variables are one of the key ways that we can get information into a process when it launches.<\/p>\n<p>[&#8230;]<\/p>\n<p>When process finishes, search for any process by the current user that have the right environment variable\/value combination<\/p>\n<p>Kill all the escaped processes you found<\/p>\n<\/blockquote>\n<p>However, as of macOS 11, System Integrity Protection prevents reading other processes&rsquo; environment variables&mdash;probably for the best.<\/p>","protected":false},"excerpt":{"rendered":"<p>Ben Martin: Now what happens when the program crashes during a test? The developer is happy because they found a bug before submitting it. But the machine may not be. This type of crash will often leave behind child processes which will quickly gunk up the server, causing other tests to fail in unexpected ways. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-09-05T19:04:23Z","apple_news_api_id":"b0ef1681-951b-4f3a-97f1-61afba86c4f7","apple_news_api_modified_at":"2022-09-05T19:04:59Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AsO8WgZUbTzqX8WGvuobE9w","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[30,1891,355,1235,268,163],"class_list":["post-36932","post","type-post","status-publish","format-standard","hentry","category-technology","tag-mac","tag-macos-11-0","tag-privacy","tag-system-integrity-protection","tag-testing","tag-unix"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=36932"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36932\/revisions"}],"predecessor-version":[{"id":36933,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36932\/revisions\/36933"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=36932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=36932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=36932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}