{"action":"created","comment":{"url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/comments/72009580","id":72009580,"diff_hunk":"@@ -11,7 +11,7 @@ for i in $(seq 1 \"${BUILDKITE_AGENTS_PER_INSTANCE}\"); do\n   service \"buildkite-agent-${i}\" stop &\n \n   # Need to ensure it's the buildkite-agent user, so it doesn't match this lifecycld handler script\n-  while pgrep -u buildkite-agent buildkite-agent > /dev/null; do\n+  while pgrep -u buildkite-agent buildkite-agent-${i} > /dev/null; do","path":"packer/conf/buildkite-agent/scripts/buildkite-agent-lifecycled-handler","position":5,"original_position":5,"commit_id":"31d92696e29e4be7556dccfe253da028bc36c47a","original_commit_id":"31d92696e29e4be7556dccfe253da028bc36c47a","user":{"login":"toolmantim","id":153,"avatar_url":"https://avatars.githubusercontent.com/u/153?v=3","gravatar_id":"","url":"https://api.github.com/users/toolmantim","html_url":"https://github.com/toolmantim","followers_url":"https://api.github.com/users/toolmantim/followers","following_url":"https://api.github.com/users/toolmantim/following{/other_user}","gists_url":"https://api.github.com/users/toolmantim/gists{/gist_id}","starred_url":"https://api.github.com/users/toolmantim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolmantim/subscriptions","organizations_url":"https://api.github.com/users/toolmantim/orgs","repos_url":"https://api.github.com/users/toolmantim/repos","events_url":"https://api.github.com/users/toolmantim/events{/privacy}","received_events_url":"https://api.github.com/users/toolmantim/received_events","type":"User","site_admin":false},"body":"Nice, thanks! Good catch. Can you add double quotes around that just for bash listing and it's good for merge party?","created_at":"2016-07-25T05:15:07Z","updated_at":"2016-07-25T05:15:08Z","html_url":"https://github.com/buildkite/elastic-ci-stack-for-aws/pull/101#discussion_r72009580","pull_request_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/comments/72009580"},"html":{"href":"https://github.com/buildkite/elastic-ci-stack-for-aws/pull/101#discussion_r72009580"},"pull_request":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/101","id":78625160,"html_url":"https://github.com/buildkite/elastic-ci-stack-for-aws/pull/101","diff_url":"https://github.com/buildkite/elastic-ci-stack-for-aws/pull/101.diff","patch_url":"https://github.com/buildkite/elastic-ci-stack-for-aws/pull/101.patch","issue_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/issues/101","number":101,"state":"open","locked":false,"title":"Have the lifecycled handler script look for just the build agent it is trying to shut down.","user":{"login":"joffotron","id":336405,"avatar_url":"https://avatars.githubusercontent.com/u/336405?v=3","gravatar_id":"","url":"https://api.github.com/users/joffotron","html_url":"https://github.com/joffotron","followers_url":"https://api.github.com/users/joffotron/followers","following_url":"https://api.github.com/users/joffotron/following{/other_user}","gists_url":"https://api.github.com/users/joffotron/gists{/gist_id}","starred_url":"https://api.github.com/users/joffotron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joffotron/subscriptions","organizations_url":"https://api.github.com/users/joffotron/orgs","repos_url":"https://api.github.com/users/joffotron/repos","events_url":"https://api.github.com/users/joffotron/events{/privacy}","received_events_url":"https://api.github.com/users/joffotron/received_events","type":"User","site_admin":false},"body":"Otherwise, it gets stuck as other agents are still running, and matching\r\nthe pgrep\r\n\r\n![terminate failing](https://cloud.githubusercontent.com/assets/336405/17090491/60c5100c-5274-11e6-9b66-aa1953c29c55.png)\r\n","created_at":"2016-07-25T04:31:12Z","updated_at":"2016-07-25T05:15:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3d57e1ba84e15dd40ad632e209f8c9c9fd56578","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/101/commits","review_comments_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/101/comments","review_comment_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/issues/101/comments","statuses_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/statuses/31d92696e29e4be7556dccfe253da028bc36c47a","head":{"label":"caremonkey:fix-lifecycled-shutdown-pgrep","ref":"fix-lifecycled-shutdown-pgrep","sha":"31d92696e29e4be7556dccfe253da028bc36c47a","user":{"login":"caremonkey","id":20216756,"avatar_url":"https://avatars.githubusercontent.com/u/20216756?v=3","gravatar_id":"","url":"https://api.github.com/users/caremonkey","html_url":"https://github.com/caremonkey","followers_url":"https://api.github.com/users/caremonkey/followers","following_url":"https://api.github.com/users/caremonkey/following{/other_user}","gists_url":"https://api.github.com/users/caremonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/caremonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caremonkey/subscriptions","organizations_url":"https://api.github.com/users/caremonkey/orgs","repos_url":"https://api.github.com/users/caremonkey/repos","events_url":"https://api.github.com/users/caremonkey/events{/privacy}","received_events_url":"https://api.github.com/users/caremonkey/received_events","type":"Organization","site_admin":false},"repo":{"id":61761618,"name":"buildkite-aws-elastic-stack","full_name":"caremonkey/buildkite-aws-elastic-stack","owner":{"login":"caremonkey","id":20216756,"avatar_url":"https://avatars.githubusercontent.com/u/20216756?v=3","gravatar_id":"","url":"https://api.github.com/users/caremonkey","html_url":"https://github.com/caremonkey","followers_url":"https://api.github.com/users/caremonkey/followers","following_url":"https://api.github.com/users/caremonkey/following{/other_user}","gists_url":"https://api.github.com/users/caremonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/caremonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caremonkey/subscriptions","organizations_url":"https://api.github.com/users/caremonkey/orgs","repos_url":"https://api.github.com/users/caremonkey/repos","events_url":"https://api.github.com/users/caremonkey/events{/privacy}","received_events_url":"https://api.github.com/users/caremonkey/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/caremonkey/buildkite-aws-elastic-stack","description":"A Docker-enabled, auto-scaling cloud of Buildkite agents on AWS using EC2 and Cloud Formation","fork":true,"url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack","forks_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/forks","keys_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/teams","hooks_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/hooks","issue_events_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/issues/events{/number}","events_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/events","assignees_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/assignees{/user}","branches_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/branches{/branch}","tags_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/tags","blobs_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/statuses/{sha}","languages_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/languages","stargazers_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/stargazers","contributors_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/contributors","subscribers_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/subscribers","subscription_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/subscription","commits_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/contents/{+path}","compare_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/merges","archive_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/downloads","issues_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/issues{/number}","pulls_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/pulls{/number}","milestones_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/milestones{/number}","notifications_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/labels{/name}","releases_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/releases{/id}","deployments_url":"https://api.github.com/repos/caremonkey/buildkite-aws-elastic-stack/deployments","created_at":"2016-06-23T00:55:39Z","updated_at":"2016-06-30T05:33:55Z","pushed_at":"2016-07-25T04:30:00Z","git_url":"git://github.com/caremonkey/buildkite-aws-elastic-stack.git","ssh_url":"git@github.com:caremonkey/buildkite-aws-elastic-stack.git","clone_url":"https://github.com/caremonkey/buildkite-aws-elastic-stack.git","svn_url":"https://github.com/caremonkey/buildkite-aws-elastic-stack","homepage":"","size":436,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"buildkite:master","ref":"master","sha":"67879db1e08e17aa3a6034e010420cb12126f30d","user":{"login":"buildkite","id":5055988,"avatar_url":"https://avatars.githubusercontent.com/u/5055988?v=3","gravatar_id":"","url":"https://api.github.com/users/buildkite","html_url":"https://github.com/buildkite","followers_url":"https://api.github.com/users/buildkite/followers","following_url":"https://api.github.com/users/buildkite/following{/other_user}","gists_url":"https://api.github.com/users/buildkite/gists{/gist_id}","starred_url":"https://api.github.com/users/buildkite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildkite/subscriptions","organizations_url":"https://api.github.com/users/buildkite/orgs","repos_url":"https://api.github.com/users/buildkite/repos","events_url":"https://api.github.com/users/buildkite/events{/privacy}","received_events_url":"https://api.github.com/users/buildkite/received_events","type":"Organization","site_admin":false},"repo":{"id":36488517,"name":"elastic-ci-stack-for-aws","full_name":"buildkite/elastic-ci-stack-for-aws","owner":{"login":"buildkite","id":5055988,"avatar_url":"https://avatars.githubusercontent.com/u/5055988?v=3","gravatar_id":"","url":"https://api.github.com/users/buildkite","html_url":"https://github.com/buildkite","followers_url":"https://api.github.com/users/buildkite/followers","following_url":"https://api.github.com/users/buildkite/following{/other_user}","gists_url":"https://api.github.com/users/buildkite/gists{/gist_id}","starred_url":"https://api.github.com/users/buildkite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildkite/subscriptions","organizations_url":"https://api.github.com/users/buildkite/orgs","repos_url":"https://api.github.com/users/buildkite/repos","events_url":"https://api.github.com/users/buildkite/events{/privacy}","received_events_url":"https://api.github.com/users/buildkite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/buildkite/elastic-ci-stack-for-aws","description":"A simple, flexible, auto-scaling cluster of build agents running in your own AWS VPC","fork":false,"url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws","forks_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/forks","keys_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/teams","hooks_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/hooks","issue_events_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/issues/events{/number}","events_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/events","assignees_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/assignees{/user}","branches_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/branches{/branch}","tags_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/tags","blobs_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/languages","stargazers_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/stargazers","contributors_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/contributors","subscribers_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/subscribers","subscription_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/subscription","commits_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/contents/{+path}","compare_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/merges","archive_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/downloads","issues_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/issues{/number}","pulls_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/labels{/name}","releases_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/releases{/id}","deployments_url":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/deployments","created_at":"2015-05-29T07:28:16Z","updated_at":"2016-07-22T13:51:04Z","pushed_at":"2016-07-25T04:31:13Z","git_url":"git://github.com/buildkite/elastic-ci-stack-for-aws.git","ssh_url":"git@github.com:buildkite/elastic-ci-stack-for-aws.git","clone_url":"https://github.com/buildkite/elastic-ci-stack-for-aws.git","svn_url":"https://github.com/buildkite/elastic-ci-stack-for-aws","homepage":"https://buildkite.com/docs/agent","size":696,"stargazers_count":41,"watchers_count":41,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":6,"forks":24,"open_issues":6,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/101"},"html":{"href":"https://github.com/buildkite/elastic-ci-stack-for-aws/pull/101"},"issue":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/issues/101"},"comments":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/buildkite/elastic-ci-stack-for-aws/statuses/31d92696e29e4be7556dccfe253da028bc36c47a"}}}}
{"actor":{"display_login":"toolmantim"}}